Commercial workflow page

Fill PDFs With Node.js — JSON-to-PDF API for JavaScript Backends

Send a JSON payload from Node.js, get back a filled PDF. No native PDF libraries to install, no field-coordinate math, no Puppeteer headless Chrome. Free tier available.

Why most Node teams stop rolling their own PDF fill code

Filling a PDF programmatically from Node.js looks easy until the first edge case. The pdf-lib approach works for trivial forms but breaks on radio groups, checkbox encoding variants, and AcroForm flattening. PDFKit is for generating PDFs from scratch, not filling existing fillable forms. The Puppeteer + headless Chrome approach renders an HTML overlay onto a PDF but ships a 200MB browser, breaks on scaled layouts, and is hard to deploy on serverless platforms.

The DullyPDF API is a thin layer over the same field-detection and fill engine the web product uses. The Node.js call is one HTTPS POST. No SDK, no native bindings, no font shipping. The PDF is detected and the field map is frozen at template publish time, so the JSON contract is stable across deployments.

Minimal Node.js example

A typical call from a Node.js backend looks like the snippet below. The endpoint URL and API key come from the API Fill modal in the DullyPDF workspace after you publish a saved template. The JSON body uses three top-level keys: a `data` object whose keys are the cleaned field names from your saved template, an `exportMode` flag (`"flat"` returns a non-editable PDF, `"editable"` keeps the AcroForm intact), and a `strict` boolean (set true so unknown payload keys are rejected instead of silently ignored).

Authentication is HTTP Basic with the API key as the username and a blank password — equivalent to sending `Authorization: Basic base64(API_KEY + ":")`. The response body is the raw PDF.

  • import { writeFile } from "node:fs/promises";
  • const apiKey = process.env.DULLYPDF_API_KEY;
  • const auth = `Basic ${Buffer.from(`${apiKey}:`).toString("base64")}`;
  • const res = await fetch("https://api.dullypdf.com/api/v1/fill/<TEMPLATE_ID>.pdf", {
  • method: "POST",
  • headers: { "Content-Type": "application/json", Authorization: auth },
  • body: JSON.stringify({ data: { patient_name: "Jane Doe", patient_email: "jane@example.com" }, exportMode: "flat", strict: true }),
  • });
  • if (!res.ok) throw new Error(`fill failed: ${res.status} ${await res.text()}`);
  • await writeFile("./filled.pdf", Buffer.from(await res.arrayBuffer()));

Where this fits in a typical Node app

The Node.js teams that get the most out of an external PDF fill API tend to share a shape. They have an existing CRUD or workflow app where the user has just submitted a form, finished an order, completed a benefits enrollment, or signed a contract. They need to render that record into a specific PDF — an ACORD certificate, an HR onboarding packet, a fillable government form, a generated invoice — and either email it, store it, or hand it back to the user.

In that shape, every native PDF library forces you to think about field positions, font embedding, encryption, and AcroForm internals. An external API replaces that with one HTTPS call and a JSON payload that mirrors the database row you already have. That removes most of the surface area where in-house PDF code goes wrong.

  • Insurance back-office: render a filled ACORD 25 from the policy record after binding.
  • HR / staffing: render a populated I-9 + W-4 packet on hire-confirmed.
  • Healthcare-adjacent (non-PHI): render an intake summary PDF for the customer record.
  • Internal ops: scheduled job renders 50 filled certificates from yesterday's submissions.

Comparison with native Node.js PDF approaches

There is a place for in-process PDF libraries. If you control the source PDF and the form is trivial — a single page with a handful of named text fields and no checkboxes or radios — pdf-lib is fine. If you are generating a PDF from scratch and never touching an existing fillable template, PDFKit is the right tool. The DullyPDF API is the right tool when the source PDF is non-trivial, the field set needs detection, or the same template is going to be filled by more than one caller from more than one runtime.

  • pdf-lib: good for trivial AcroForms, weak on radio groups + checkbox variants + flattening.
  • PDFKit: PDF generation from scratch, not fillable-form filling. Different tool category.
  • Puppeteer + Chrome: works but ships a browser, slow cold start, hard on serverless.
  • DullyPDF API: one HTTPS POST, no native deps, template-scoped schema, field detection done once.

Deployment shapes that work well

Because the API is a single HTTPS endpoint, every Node deployment shape works without extra setup. From a long-running Express server, the call is fetch + write to disk. From a Next.js Route Handler the same fetch returns a Response that streams straight back to the browser. AWS Lambda, Google Cloud Functions, Cloudflare Workers, and Vercel Edge all work because there are no native dependencies to ship in the bundle. Cold starts stay fast because no PDF library has to be loaded into memory on the calling side.

When you outgrow the free tier

The free tier covers prototypes and low-volume production. Once you cross the request quota, the single Premium tier raises the limits without a separate plan negotiation. The published endpoint and field schema do not change when the plan changes — only the quotas do. That means scaling up does not force a code change.

Why teams use PDF Fill API for Node.js

  • POST a JSON body, get a filled PDF back. No native bindings, no font shipping, no headless Chrome.
  • Works from any Node.js runtime: Express, Next.js API routes, Lambda, Cloud Functions, Cloudflare Workers (via fetch).
  • Free tier covers low-volume workloads end to end before any paid commitment.

Implementation signals for PDF Fill API for Node.js

  • API call is a standard HTTPS POST with a JSON payload — no SDK install required.
  • Field schema is downloadable from the saved template so the JSON contract is visible to the calling code.
  • Each published endpoint is template-scoped so a template revision does not silently break callers.

Need deeper technical details about pdf fill api for node.js? Use the Rename + Mapping docs and Search & Fill docs to validate exact behavior.

Frequently asked questions about PDF Fill API for Node.js

Do I need an SDK or npm package?

No. The API is plain HTTPS + JSON, callable with the global fetch in modern Node.js or any HTTP client. An optional client library is on the roadmap but not required.

Can I call this from Next.js, Lambda, or Cloudflare Workers?

Yes. Because the call is plain fetch with no native dependencies, every Node-compatible runtime works including edge environments.

How do I know what JSON keys to send?

Each published endpoint exposes a downloadable schema with the exact field names you reviewed during template setup. The schema is template-scoped and only changes when you intentionally republish.

Can I rotate the API key without redeploying?

Yes. Endpoint keys can be rotated from the workspace. The endpoint URL stays stable; only the bearer token changes.

How does this compare to pdf-lib?

pdf-lib is a low-level Node library. It works well for trivial AcroForms but requires you to handle field detection, radio group encoding, and flattening yourself. The DullyPDF API does that work once at template setup time and exposes a stable JSON contract to the calling code.

Docs for PDF Fill API for Node.js

Use these docs pages to verify the exact DullyPDF behavior behind pdf fill api for node.js before you ship it as a repeat workflow.

Related routes for PDF Fill API for Node.js

These adjacent workflow pages cover nearby search intents teams compare while evaluating pdf fill api for node.js.