Opened from the filesystem. The iOS API reference will be blank — it fetches its content and needs a real origin. Run ./serve.sh in this directory.

PDFCora for Node

API referenceEvery public type, generated by TypeDoc

Install

npm install @pdfcora/node

The packages are not published yet. Until they are, build from source: see Getting a working checkout.

A thin layer over @pdfcora/web rather than a second implementation: the whole web API is re-exported, so anything the web SDK does — annotations, form filling, redaction, tagging, signatures, viewer state, the AI package, the agent tools — works unchanged on the server. The same WebAssembly engine, so nothing to compile.

Open and render

import { writeFile } from 'node:fs/promises';
import { openFile, renderPng } from '@pdfcora/node';

const doc = await openFile('contract.pdf');
await writeFile('page-1.png', await renderPng(await doc.page(0), { width: 1024 }));

The PNG encoder uses node:zlib; there is no image dependency.

What Node adds

openFile(path, password?)       // read and open in one call
saveFile(doc, path, mode?)      // save straight to disk
renderPng(page, options?)       // encoded PNG bytes
renderRaw(page, options?)       // the raw RGBA buffer, for sharp or canvas

Sign it

The web SDK takes a CMS implementation you supply; on Node that can be a JCA-style library, an HSM client or a remote signing service.

const signed = await doc.sign({
  // Return a CAdES-BES CMS, or pass subFilter: 'adbe.pkcs7.detached' for plain PKCS#7.
  signer: { async sign(data) { /* ... */ } },
  reason: 'Approved',
});

As on the web, signing uses the bytes the document was opened from, so edits made in memory are not in the signed file. To sign edits, save, reopen, then sign.

Tools for AI agents

The MCP server in mcp/ runs over stdio and exposes reading, proposals and an apply that takes only the ids a person accepted.

All platforms