Fork PDF Documentation
The forkpdf SDK provides a streamlined interface for generating pixel-perfect PDFs and
interacting with spatial layouts using the Fork PDF API. Our current SDK version is 2.1.0, with
native ESM and CommonJS support, spatial schema v2, per-page element fragments, inline formatting contexts,
shaped runs, AbortSignal cancellation, safe GET retries/backoff, and typed
getComplianceCapabilities().
Machine-readable API contract: OpenAPI 3.1 (JSON) · YAML.
Building with AI Assistants & Coding Agents?
Add our authoritative specification file to your project root to eliminate hallucinated methods and parameters in OpenCode, Claude Code, Cursor, or Windsurf.
Examples
End-to-end documents you can run against the API.
- Example library — eight production-ready invoice, contract, form, label, and report examples with full source on GitLab.
- Q3 report — hosted walkthrough: auto-generated TOC, chart/commentary healing, and signature coordinates in one API call.
- Travel itinerary — hosted walkthrough: five checks, two dependent patches, and a day index/page total measured after the layout settles.
- Invoice self-healing — hosted walkthrough: table overflow, Tier 1 patches, and a Tier 2 webhook fallback.
Free tools
- HTML to PDF playground — test HTML, CSS, JavaScript, PDF/A, PDF/UA, strict fonts, and region routing without signup.
Guides
- Node.js PDF generator — compare Puppeteer, Playwright, PDFKit, and a managed API; production guide for templates, fonts, page breaks, and webhooks.
- Automated PDF layout testing — catch broken pages before delivery.
- Agency report PDFs — white-label client reports with layout checks.
- Invoice PDF generation — line items, totals, signatures, and multi-page invoices.
- Async PDF generation — webhooks, retries, and DLQ handling.
- Table of contents — real page numbers measured after layout.
- Fix HTML-to-PDF page breaks — stop tables splitting, content cut off, and headers disappearing across pages.
- Element coordinates — signature placement with PDF points.
- PDF generator API — what to check before choosing one.
- PDF/A and PDF/UA capabilities — standalone and combined output, font policy, and discovery.
- PDF/UA-1/2 generation — stable tagged output, per-element language tags, authoring requirements, validation evidence, and limitations.
- PDF/UA-2 validation and proof — exact files, hashes, and veraPDF results.
- WCAG 2.2 AA checks — automated results, source and PDF hashes, raw reports, and evidence downloads.
- Limits & file sizes — request, PDF, ZIP, and
testResultslimits.