TypeScript/Node.js SDK for AI-powered PDF form filling — extract fields, map data, and fill any PDF form automatically.
Status: This SDK is under active development. For production use today, see the Python SDK or the live platform at pdffillr.ai.
pdf-autofillr extracts form fields from any PDF, maps your data to those fields using an LLM of your choice, and returns a filled PDF — programmatically, at scale.
Blank PDF + your data
│
▼
embed (once per template) ← extract fields → LLM map → bake metadata
│
▼
fill (per submission) ← inject data → return filled PDF
npm install pdf-autofillr
# or
yarn add pdf-autofillrimport { PDFAutofillr } from "pdf-autofillr";
import { readFileSync, writeFileSync } from "node:fs";
async function main() {
const client = new PDFAutofillr({ apiKey: process.env.PDF_AUTOFILLR_API_KEY });
// Step 1: Embed metadata into a template (once per PDF)
const embedded = await client.embed({
pdf: readFileSync("form.pdf"),
schemaKeys: ["first_name", "last_name", "date_of_birth"],
});
// Step 2: Fill the template with data
const filled = await client.fill({
pdf: embedded.pdf,
data: { first_name: "Jane", last_name: "Doe", date_of_birth: "1990-01-15" },
});
writeFileSync("filled_form.pdf", filled.pdf);
}
main();Requires Node.js 18+ (ESM or CJS with async/await support).
Works with any LLM via the platform:
| Provider | Models |
|---|---|
| OpenAI | gpt-4o, gpt-4o-mini |
| Anthropic | claude-3-5-haiku-latest, claude-3-5-sonnet-latest |
gemini-1.5-flash, gemini-1.5-pro |
|
| Ollama (local) | llama3.1, mistral |
| Package | Language | Description |
|---|---|---|
| pdf-autofillr-python-sdk | Python | Full-featured Python SDK (stable) |
| pdf-autofillr-cli | CLI | Fill PDFs from your terminal |
| pdf-autofillr-plugins | Any | Custom extractors and LLM adapters |
| autofiller-community | Open-source | Community models and domain packs |
Contributions are welcome! Open an issue or submit a pull request.
MIT — see LICENSE