Skip to main content
Node.js PDF SDK

Node.js PDF SDK for Editing Existing PDFs

Edit existing PDF text and objects from Node.js 20+ with TypeScript support, asynchronous operations, explicit layout modes, and structured result diagnostics.

Read PDF bytes, await the edit, and validate the response

Download the public quick-start PDF as input.pdf. This byte-input example checks both errors and the expected change count before writing the result.

Call typed APIs for text, pages, images, forms, vectors, and fonts

Typed text requests

Build literal or regular-expression replace, insert, delete, and style operations with TypeScript types.

Read the operation guide

Explicit layout modes

Choose source anchoring, supported reflow with fallback, or required reflow on each request.

Read the operation guide

Extract typed reading units from a document or page

Analyze the current session as classified text blocks with reading order, source-element provenance, page-space bounds, and relationships. Each asynchronous call reflects the current session state.

Read the structured-text guide

Choose between anchored placement, reflow when possible, and required reflow

Select how replacement text should behave when its length changes: keep it anchored to the original position, reflow it when the document structure supports reflow, or require reflow and return an error when it cannot be applied.

  • sourceAnchored() retains the selected source position.
  • reflowWhenSupported() permits source-anchored fallback.
  • requireReflow() reports unsupported targets as errors.

Return edited bytes from an Express route

The route reads uploaded bytes from Multer memory storage, checks the SDK result, and returns the edited PDF. Configure upload-size limits in Multer, authentication in Express middleware, timeouts in the HTTP server or deployment platform, and error responses in Express error-handling middleware.

Check runtime and deployment constraints

RuntimeNode.js 20+
Client modelAsynchronous
InputUint8Array, ArrayBuffer, or path
ProcessingHosted PDFDancer service
  • The package targets Node.js 20+. Node.js support does not establish compatibility with edge-worker runtimes.
  • PDFDancer uses a hosted service; installing the npm package does not create an offline PDF processor.
  • Text selectors require editable PDF text rather than outlines, paths, page images, or unsupported encodings.
  • reflowWhenSupported() can fall back to source-anchored placement. Inspect per-change diagnostics.
  • Font registration does not guarantee that a font includes every replacement character.
  • Saving output does not certify PDF/A conformance, preserve signatures, or provide security redaction.

Continue from the TypeScript quick start to the API reference

Node.js PDF SDK questions

Start Using PDFDancer Today

Get started in seconds with our free tier. No credit card required.

Want to evaluate first? Run the anonymous quick start. Current usage limits are on the pricing page.