Skip to main content

Best PDF Generation APIs for Developers

·APIScout Team
pdf-apihtml-to-pdfdocument-generationdeveloper-toolsroundup

Best PDF Generation APIs for Developers

PDF generation sounds simple until you actually build it. Invoices, reports, contracts, shipping labels, certificates — every application eventually needs to produce a PDF, and the rendering quality, CSS support, and scalability requirements vary depending on the use case.

The market in 2026 splits into three camps: managed APIs that handle rendering infrastructure, template-driven platforms for non-developers, and open-source engines you host yourself. This guide evaluates the six most relevant options, assessed on rendering quality, API design, pricing, and specific use cases.

TL;DR

DocRaptor produces the highest-quality PDFs using the Prince rendering engine — the gold standard for print-ready output. PDFShift offers the cleanest API-first experience for Chromium-based HTML-to-PDF conversion. For template-driven workflows like invoices and reports, CraftMyPDF provides a drag-and-drop editor with JSON-to-PDF generation. Developers who want full control should evaluate Puppeteer (Node.js) or Gotenberg (Docker) as self-hosted alternatives.

Key Takeaways

  • DocRaptor uses PrinceXML under the hood — the same engine used by book publishers. It produces PDFs with superior typographic control, CSS Paged Media support, and print-quality output that Chromium-based converters cannot match. Free tier: 5 docs/month, paid from $15/month.
  • PDFShift is the most developer-friendly managed API for Chromium-based conversion. Credit-based pricing (1 credit per 5MB), parallel/async processing, and S3 delivery make it well-suited for batch workflows. Free tier: 50 credits/month.
  • CraftMyPDF takes a template-first approach with a visual drag-and-drop editor. Send JSON data to the API, get a formatted PDF back. Ideal for invoices, certificates, and reports where non-developers need to control layout. Free tier: 50 PDFs/month, 3 templates.
  • Puppeteer gives you full headless Chrome control via Node.js. Free and open source. Full modern CSS/JS rendering. You handle the infrastructure.
  • Gotenberg wraps Chromium and LibreOffice in a Docker container with a clean multipart API. Converts HTML, Markdown, and Office documents to PDF. Free, open source, designed for microservice architectures.
  • wkhtmltopdf is deprecated and archived. Still found in legacy codebases, but its WebKit engine is frozen at 2015-era rendering. Migrate away.

The PDF Generation Landscape in 2026

Three dynamics shape the PDF generation market in 2026.

Chromium dominates rendering. Most managed APIs and open-source tools now use headless Chromium for HTML-to-PDF conversion — modern CSS Grid, Flexbox, web fonts, and JavaScript all work out of the box. The trade-off: Chromium-based PDFs look like printed web pages, not typeset documents. For true print quality — precise page breaks, widow/orphan control, PDF/A compliance — PrinceXML (via DocRaptor) remains the only serious option.

Template-driven generation is rising. Not every PDF starts as HTML. Platforms like CraftMyPDF let teams design templates visually and populate them via API with JSON data, separating document design from application code.

Self-hosted options have matured. Gotenberg and Puppeteer have reached production quality. Teams with Docker infrastructure can run their own PDF generation with zero per-document costs, trading API fees for operational overhead.

Quick Comparison Table

ProviderEngineBest ForFree TierPaid FromSelf-Hosted
DocRaptorPrinceXMLPrint-quality PDFs5 docs/mo$15/mo (125 docs)No
PDFShiftChromiumAPI-first HTML-to-PDF50 credits/mo$24/mo (2,500 credits)No
CraftMyPDFProprietaryTemplate-driven generation50 PDFs/mo, 3 templates$29/mo (1,200 PDFs)No
PuppeteerChromiumFull browser controlOpen sourceInfra costsYes
GotenbergChromium + LibreOfficeDocker microserviceOpen sourceInfra costsYes
wkhtmltopdfQtWebKit (frozen)Legacy systems onlyOpen sourceN/AYes (deprecated)

1. DocRaptor — Best Print-Quality Output

Best for: Compliance documents, financial reports, print-ready invoices, and any PDF where pixel-perfect layout and typographic precision matter.

DocRaptor is a managed API powered by PrinceXML, the same rendering engine used by publishers and print houses. Where Chromium-based converters render HTML as a browser would, Prince renders HTML using CSS Paged Media — a specification designed specifically for paginated documents. The difference is visible: proper widow/orphan control, running headers and footers, cross-references, footnotes, and precise page break control.

The API is straightforward. Send HTML (or a URL) via POST, receive a PDF. Prince's CSS support goes beyond what browsers implement — @page rules, named pages, page counters, leaders (dot fills for table of contents), and CSS-based bookmarks. If you have ever fought with Chromium's page-break-inside: avoid and lost, DocRaptor is the answer. It also generates Excel files from HTML tables and provides deterministic rendering — the same input always produces the same output.

Key Features:

  • PrinceXML rendering engine for print-quality output
  • CSS Paged Media support (@page, named pages, margins, counters)
  • Widow/orphan control, footnotes, cross-references, bookmarks
  • PDF/A compliance for archival documents
  • Excel generation from HTML tables
  • JavaScript execution during rendering
  • Unlimited free test documents (watermarked)
  • SDKs for Ruby, Python, Node, PHP, Java, and .NET

Pricing:

  • Free: 5 documents/month
  • Basic: $15/month (125 documents, $0.12/doc overage)
  • Professional: $29/month (325 documents)
  • Premium: $75/month (1,250 documents)
  • Max: $149/month (5,000 documents)
  • Bronze: $399/month (15,000 documents)
  • Enterprise: custom pricing

Limitations: Per-document pricing gets expensive at high volumes. Prince renders CSS differently from Chromium — browser-designed HTML may need adjustment for the Prince engine. Limited JavaScript support compared to headless Chrome. No template editor or visual design tool. Higher per-document cost than any other option on this list.


2. PDFShift — Best API-First Experience

Best for: Developers who want the fastest path from HTML or a URL to a PDF with no infrastructure to manage.

PDFShift is a Chromium-based HTML-to-PDF API built for developer ergonomics. The API design is clean: POST your HTML or URL, configure options (margins, headers/footers, page size), and get a PDF back. Where PDFShift stands out is in its production-oriented features — parallel conversions for batch processing, asynchronous generation with webhooks, direct S3 delivery, and a credit system that makes cost predictable.

The credit model is straightforward: 1 credit per conversion up to 5MB. A 14MB document uses 3 credits. This granularity makes costs predictable for applications generating documents of varying sizes. Overage charges are disabled by default — you opt in to automatic billing beyond your plan limit, so there are no surprise costs.

Key Features:

  • Chromium-based rendering with full modern CSS/JS support
  • Parallel and asynchronous batch conversions
  • Webhook notifications for async processing
  • Direct AWS S3 delivery (bypass your servers)
  • CSS and JavaScript injection
  • Custom headers and footers with HTML templates
  • PDF encryption and watermarking
  • Template storage for faster repeat conversions

Pricing:

  • Free: 50 credits/month (2MB max file size, 30s timeout)
  • Boost: $24/month (2,500 credits, $0.03/credit overage)
  • Annual plans: pay for 10 months (2 months free)
  • Enterprise: custom plans for higher volume

Limitations: Chromium rendering — same quality as printing from Chrome, which is good but not print-grade. Free tier has a 2MB file size limit and 30-second timeout. No template editor — you build HTML yourself. Lacks advanced print CSS features (no footnotes, cross-references, or page margin boxes).


3. CraftMyPDF — Best Template-Driven Generation

Best for: Invoices, certificates, receipts, reports, and documents where non-developers need to design and update templates without writing code.

CraftMyPDF takes a fundamentally different approach from HTML-to-PDF converters. Instead of writing HTML, you design PDF templates in a drag-and-drop visual editor — add text fields, images, tables, barcodes, QR codes, and layout elements. Then send JSON data to the API, and CraftMyPDF merges data into the template to produce a PDF.

This separation of design and data is powerful for teams where marketing, finance, or operations need to control document appearance. Template changes do not require code deployments. The platform supports expressions for formatting dates, currencies, and numbers, plus conditional logic for showing/hiding sections based on data values.

Key Features:

  • Drag-and-drop visual template editor
  • JSON-to-PDF generation via REST API
  • Fillable PDF components (text fields, dropdowns, checkboxes)
  • Expressions and conditional logic in templates
  • Barcode and QR code generation
  • No-code integrations (Zapier, Make.com, Bubble.io)
  • Image generation from templates (PNG/JPEG)
  • PDF password protection (Professional tier and above)

Pricing:

  • Free: 50 PDFs/month, 3 templates
  • Lite: $29/month (1,200 PDFs, 6 templates)
  • Plus: $49/month (3,000 PDFs, 15 templates)
  • Professional: $99/month (12,000 PDFs, 50 templates, AWS S3)
  • Premium: $299/month (40,000 PDFs, 1,000 templates)
  • Annual plans save up to 17%

Limitations: Template-driven approach does not suit all use cases — complex, data-dense reports with dynamic layouts are easier to build in HTML. Template count is limited per tier. Learning the template editor and expression syntax takes time. Cannot convert arbitrary HTML or web pages to PDF. Less flexible than raw HTML-to-PDF for highly custom documents.


4. Puppeteer — Best Open-Source (Node.js)

Best for: Node.js developers who need full browser control, pixel-perfect Chromium rendering, and zero per-document costs.

Puppeteer is Google's official Node.js library for controlling headless Chrome/Chromium. PDF generation is one capability among many — Puppeteer also handles screenshots, DOM manipulation, form filling, and end-to-end testing. The page.pdf() method converts any rendered page to PDF with options for format, margins, headers/footers, page ranges, and background graphics.

Because Puppeteer runs a real browser, it renders everything Chrome can: CSS Grid, Flexbox, web fonts, SVG, Canvas, and JavaScript-generated content. Playwright (by Microsoft) is a strong alternative with identical Chromium PDF output plus Firefox and WebKit support.

Key Features:

  • Full headless Chrome/Chromium control
  • page.pdf() with format, margins, scale, header/footer templates
  • Complete modern CSS support (Grid, Flexbox, web fonts)
  • JavaScript execution — renders dynamic/SPA content
  • Network interception for authentication and custom headers
  • Device emulation for responsive layouts
  • Page ranges, landscape mode, and custom dimensions
  • Active development matching Chrome release cadence

Pricing: Free and open source (Apache 2.0 license). Infrastructure costs for running headless Chrome — plan for 200-500MB of memory per browser instance.

Limitations: Self-hosted infrastructure required. Chromium processes are memory-hungry — scaling to thousands of concurrent PDFs requires careful resource management. No built-in queueing, retries, or webhook delivery. Header/footer templates use a limited HTML subset. No CSS Paged Media support. Cold start of 1-3 seconds per new browser instance.


5. Gotenberg — Best Docker-Based Solution

Best for: Teams with Docker infrastructure who need a self-hosted PDF conversion microservice supporting HTML, Markdown, and Office documents.

Gotenberg wraps Chromium, LibreOffice, and PDF manipulation tools (QPDF, pdfcpu, ExifTool) in a Docker container with a clean REST API. It converts HTML, Markdown, URLs, and Office documents (Word, Excel, PowerPoint) to PDF via multipart/form-data requests. Unlike Puppeteer, which requires writing Node.js code, Gotenberg provides a ready-to-deploy HTTP service.

Pull the Docker image, run the container, and POST documents to the API. Gotenberg handles Chromium and LibreOffice process management, memory limits, and timeouts. Cloud Storage integration (S3, GCS, MinIO) allows direct file streaming without routing through your application.

Key Features:

  • Docker container with Chromium + LibreOffice engines
  • HTML, Markdown, URL, and Office document conversion (DOCX, XLSX, PPTX)
  • PDF merging, splitting, and flattening
  • PDF security (user/owner passwords, metadata, attachments)
  • Webhook support for async processing
  • Cloud Storage integration (S3, GCS, MinIO)
  • Configurable timeouts, memory limits, and concurrency
  • Prometheus metrics for monitoring
  • Modular architecture for custom configuration

Pricing: Free and open source (MIT license). Infrastructure costs for running Docker containers — the Chromium + LibreOffice image is approximately 1-2GB.

Limitations: Requires Docker infrastructure. Container image is large (1-2GB) due to bundled Chromium and LibreOffice. Chromium rendering quality is good but not print-grade. LibreOffice conversion fidelity for complex Office documents can differ from Microsoft Office rendering. No visual template editor. No managed/hosted option.


6. wkhtmltopdf — Legacy (Deprecated)

Best for: Nothing new. Migrate existing implementations to Puppeteer, Gotenberg, or a managed API.

wkhtmltopdf was the default open-source HTML-to-PDF converter for over a decade. It used QtWebKit to render HTML and produce PDFs. The project is now officially deprecated and archived — the GitHub repository is read-only, the Homebrew cask was disabled in December 2024, and the QtWebKit engine it depends on was removed from Qt in 2016. No security patches are being issued. Despite this, it remains embedded in thousands of production systems. If you are maintaining one, plan a migration.

Why Migrate:

  • No CSS Grid, Flexbox, custom properties, or modern web font support
  • No security patches — known vulnerabilities remain unpatched
  • QtWebKit rendering produces inconsistent output on modern HTML
  • Package managers are removing or flagging it as deprecated
  • Homebrew cask disabled since December 2024

Migration Paths: Gotenberg is the most direct replacement for server-side use cases (similar REST API, Docker deployment). Puppeteer replaces wkhtmltopdf for Node.js projects. For managed API migration, PDFShift or DocRaptor eliminate infrastructure concerns entirely.


How to Choose

Use CaseRecommendedWhy
Print-quality contracts/invoicesDocRaptorPrinceXML engine, CSS Paged Media, PDF/A
High-volume HTML-to-PDF APIPDFShiftClean API, batch processing, S3 delivery
Non-developers designing templatesCraftMyPDFVisual editor, JSON data merge, no-code integrations
Full browser control (Node.js)PuppeteerFree, modern CSS/JS, complete Chrome API
Self-hosted microservice (Docker)GotenbergMulti-format, ready-to-deploy, Office support
Replacing wkhtmltopdfGotenberg or PuppeteerDrop-in server or library replacement
Lowest per-document costPuppeteer or GotenbergOpen source, zero per-document fees
Fastest integration, no infrastructurePDFShift or DocRaptorManaged API, nothing to deploy

For startups: Start with PDFShift or DocRaptor to avoid infrastructure overhead. Switch to self-hosted when volume makes per-document pricing uneconomical.

For enterprise: Evaluate DocRaptor for print quality and PDF/A compliance. Use CraftMyPDF if business teams need to own template design. Deploy Gotenberg for multi-format conversion behind your firewall.

For high-volume (10K+ docs/month): Self-host Puppeteer or Gotenberg. Infrastructure costs for Chromium containers are significantly lower than per-document API pricing at scale.

Methodology

This guide evaluates PDF generation solutions on five criteria weighted by importance to production development teams.

  1. Rendering quality (25%). CSS support depth, typographic control, page break handling, and output fidelity. PrinceXML-based solutions score highest for print quality; Chromium-based solutions score well for modern CSS; legacy WebKit scores poorly.
  2. API design and developer experience (25%). Documentation quality, SDK availability, request/response simplicity, and time to first successful PDF.
  3. Pricing and cost efficiency (20%). Free tier generosity, per-document costs at various volumes, and total cost of ownership including infrastructure for self-hosted options.
  4. Production readiness (15%). Batch processing, async/webhook support, error handling, timeout management, and scalability characteristics.
  5. Flexibility and format support (15%). Input format support (HTML, Markdown, Office), output options (encryption, metadata, merging), and integration ecosystem (S3, webhooks, no-code platforms).

All pricing data is current as of March 2026. Managed API pricing changes periodically — verify current rates on each provider's pricing page before making decisions.


Comparing PDF generation APIs? Explore DocRaptor, PDFShift, CraftMyPDF, Puppeteer, Gotenberg, and more on APIScout — pricing, rendering quality, and developer experience across every major PDF generation platform.

Comments