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.

Read the spec Download AGENTS.md View raw

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