Comparisons

HTML to PDF API for SaaS: A Developer's Evaluation Guide

Choose an HTML-to-PDF API for your SaaS: rendering, layout observability, PDF/A and PDF/UA, forms, webhooks, pricing, and what to test first.

· 9 min read · 1,933 words · ForkPDF Engineering

If you are adding PDF generation to a SaaS product, the API choice is usually not about whether it can render HTML. Most of them can. The choice is about what happens after rendering: whether you can see where the content landed, whether a broken layout fails the request or ships to a customer, and how much of the document pipeline you want to own.

This guide is the checklist we would use to evaluate any HTML-to-PDF API for a SaaS product. It covers the decisions that show up in production, with a comparison of the common options at the end.

The short answer

  • ForkPDF fits products where the document itself is part of the product: invoices, contracts, statements, reports, labels, and forms that must be measured and sometimes must meet PDF/A or PDF/UA.
  • PDFShift fits straightforward Chromium conversions where screenshots, watermarking, and a low entry price matter more than layout introspection.
  • DocRaptor fits book-like paged media: footnotes, cross-references, running headers, and an established PDF/UA-1 profile.
  • Puppeteer or Playwright fit teams that need full browser control and are prepared to operate the browser fleet, fonts, queues, retries, storage, and validation themselves.

The rest of this guide explains how to tell which one you are.

The eight things that actually decide the choice

1. Rendering engine

Most APIs use Chromium. DocRaptor uses Prince. Puppeteer and Playwright give you a browser you host yourself.

Chromium is the right default when your templates are normal web pages: HTML, CSS, web fonts, flexbox, and the same rendering your users see. Prince is stronger when the document is closer to print: footnotes, cross-references, running headers, and mixed page layouts. A self-hosted browser gives you the most control, but you also inherit the upgrade treadmill.

Ask: Does the engine render the HTML and CSS my templates actually use? Test with the real template, not a lorem-ipsum sample.

2. Layout observability

A PDF is a write-only artifact unless the API gives you something back. For a SaaS product, the useful questions are:

  • Which page did this element land on?
  • What is its bounding box?
  • Did the table header repeat?
  • Did the signature block stay with the last line?
  • Did the chart and its commentary end up on the same page?

Some APIs return only the PDF. Some return a download URL and a file size. ForkPDF returns a queryable layout map alongside the PDF, including page numbers and geometry in PDF points. That is the difference between “the file was generated” and “the file is correct.”

3. Validation and self-healing

A layout test that runs after delivery is a monitoring tool. A layout test that runs before delivery is a quality gate.

The strongest version is a loop: query the rendered document, assert a condition, return a patch, and re-render before the customer ever sees the file. ForkPDF exposes this through testCase and patch. If a table’s last row and the totals block land on different pages, the test can return a patch and the engine re-renders.

If the API cannot re-render, ask what happens on failure. Does it return a 422 with structured results? Does it deliver a broken PDF? Does it silently truncate?

4. Compliance

PDF/A and PDF/UA are different requirements:

  • PDF/A is for long-term archiving. It constrains fonts, color, metadata, and structure so the file can be reproduced later.
  • PDF/UA is for accessibility. It requires tagged structure, reading order, alternative text, language, and other semantics.

A tagged PDF is not automatically PDF/UA conformant. A PDF/A flag is not a guarantee that every font is embedded correctly. Always validate the final artifact against the exact profile your customer or regulator requires.

ForkPDF lists PDF/A-2b, 2u, 2a, 3b, 3u, 3a, and 4, plus PDF/UA-1 and PDF/UA-2. DocRaptor documents a PDF/UA-1 profile and PDF/A through Prince profiles. PDFShift’s public documentation did not list PDF/A or PDF/UA when we checked on November 10, 2026. Puppeteer has a tagged PDF option, but tagging is not a PDF/UA conformance guarantee, and Chromium has no native PDF/A switch.

Ask: Which profile, which version, and who validates the output? “We support PDF/UA” is not enough.

5. Forms

If users need to fill, sign, or submit a document, the output may need AcroForm fields, not just a visual PDF.

ForkPDF converts standard HTML controls into AcroForm fields with pdfForm: true, and can combine forms with PDF/A and PDF/UA options. DocRaptor documents PDF forms as well. If forms are on the roadmap, test the actual controls you need: text inputs, checkboxes, radio groups, selects, multiline fields, and signatures.

6. Async delivery and storage

Long documents do not belong in a request that holds a connection open. The API should support some combination of:

  • synchronous generation with a sane timeout
  • asynchronous jobs with a webhook
  • signed download URLs
  • retries and a dead-letter path
  • managed storage or your own S3 bucket

ForkPDF supports webhooks, signed URLs, managed S3 or BYO-S3, and retry tracking. PDFShift supports webhooks and S3 delivery. DocRaptor supports async jobs with a callback. With Puppeteer or Playwright, you build this layer yourself.

Ask: What happens when the webhook receiver is down? If the answer is “the document is lost,” keep looking.

7. Pricing model

Headline prices are misleading because vendors count different things. Compare:

  • cost per successful document
  • cost per failed validation
  • minimum monthly plan
  • overage rate
  • storage and retention
  • engineering time to operate the pipeline

ForkPDF starts at $39/month for 5,000 credits; a completed generation and data extraction costs 2 credits, and a document that fails validation and is discarded costs 1. PDFShift’s published entry price was $9/month and DocRaptor’s was $15/month when we checked on November 10, 2026. Puppeteer is free software, but you pay for infrastructure, browser maintenance, and the engineer who owns it.

Ask: What does a 40-page document with one failed validation actually cost? Model your real mix, not the demo.

8. Operational burden

A self-hosted browser is not just page.pdf(). It is:

  • a browser fleet and a queue
  • font installation and version pinning
  • memory limits and concurrency control
  • retries, idempotency, and dead-letter handling
  • storage, signed URLs, and retention
  • PDF/A conversion and PDF/UA validation
  • upgrades that can change pagination

A managed API trades some control for a smaller surface area. That trade is usually right for a small team shipping a product, and usually wrong for a team whose core competency is the browser itself.

Comparison at a glance

Criterion ForkPDF PDFShift DocRaptor Puppeteer / Playwright
Engine Chromium Chromium Prince Chromium (self-hosted)
Spatial geometry Yes, via testResults Not listed Not documented Build your own
Layout tests + patch loop Yes, testCase patches Not listed Not documented Build your own
Fillable forms AcroForm via pdfForm Not listed Yes Build your own
PDF/A 2b–4 Not listed Via Prince profiles No native switch
PDF/UA UA-1 and UA-2 Not listed PDF/UA-1 profile Tagged PDF; validate
Webhooks Yes Yes Async callback Build your own
Published entry price $39/mo $9/mo $15/mo Free software + infrastructure
Best fit Measured layout, forms, compliance Simple conversions, screenshots Book-like paged media, PDF/UA-1 Full browser control

ForkPDF is our product. Competitor details and pricing are from public documentation and pricing pages verified on November 10, 2026. They can change; check the vendor source before you buy. Full comparisons: PDFShift, DocRaptor, Puppeteer and Playwright.

What to test before you commit

Use your largest realistic document, not the sample. Then test these:

  1. A table that crosses a page boundary. Does the header repeat? Do the totals stay with the last row?
  2. A chart and its commentary. Do they land on the same page after the text changes?
  3. A signature block. Can you get its page and coordinates reliably?
  4. A table of contents. Are the page numbers measured after layout, or estimated before it?
  5. The largest font and the longest string. Are glyphs embedded? Does anything fall back to a system font?
  6. The compliance profile. Run the output through a validator, not just the vendor’s dashboard.
  7. A failed webhook. Is the job retried? Can you replay it?
  8. Your real volume. What does the bill look like at 10× and 100× the demo?

If the API cannot answer questions 1–4, it is a renderer, not a document pipeline.

A code example: generate, assert, and patch

Here is the pattern in ForkPDF. The testCase runs after layout, queries the rendered document, and returns a patch if the footer and the last table row do not share a page.

JavaScript
const { ForkPDFClient } = require('forkpdf');

const client = new ForkPDFClient(
  process.env.FORKPDF_API_KEY,
  process.env.FORKPDF_PROJECT_ID
);

const htmlContent = '<h1>Invoice</h1>'; // your rendered template

const result = await client.generate({
  htmlContent,
  format: 'A4',
  spatial: true,
  unzip: true,
  downloadBuffer: true,
  testCase: `
    const rows = doc.querySelectorAll('table tbody tr');
    if (!rows.length) {
      return { success: false, reason: 'No table rows' };
    }

    const footer = doc.querySelector('.footer');
    if (!footer) {
      return { success: false, reason: 'Missing footer' };
    }

    if (footer.pages[0] !== rows[rows.length - 1].pages[0]) {
      return { success: false, patch: { compact_table_padding: true } };
    }

    return { success: true };
  `,
});

console.log(result.pdfBuffer.length);

The same doc object supports querySelector, querySelectorAll, geometry, pages, attributes, and innerText. Coordinates are in PDF points with a bottom-left origin, and pages is zero-indexed. The full query surface is in the spatial queries documentation.

Which one fits your team?

  • You run a SaaS and the PDF is a customer-facing artifact. Choose an API that returns layout data and can fail closed. ForkPDF is built for this.
  • You just need to turn a URL into a PDF and store it. A lower-cost Chromium converter is enough.
  • Your templates are closer to a book than a web page. Look at DocRaptor and Prince.
  • You need full browser control, custom fonts, and a browser you already operate. Puppeteer or Playwright can work; budget for the operations.

The wrong choice is usually not the engine. It is choosing a renderer when you needed a pipeline, or choosing a pipeline when a renderer was enough.

FAQ

What is the best HTML-to-PDF API for a SaaS app?

It depends on what happens after rendering. ForkPDF fits products that need layout geometry and compliance. PDFShift fits simple Chromium conversions. DocRaptor fits Prince-style paged media. Puppeteer or Playwright fit teams that want full browser control and can own the operations.

Should I use Puppeteer or a managed PDF API?

Use Puppeteer or Playwright if you need full browser control and can run a browser fleet, fonts, queues, retries, storage, and validation. Use a managed API if you want those concerns handled and a predictable per-document cost.

Do I need PDF/A or PDF/UA?

PDF/A is for long-term archiving. PDF/UA is for accessibility. If a customer or regulator requires either, test the exact document and profile. A tagged PDF is not automatically PDF/UA conformant.

How should I compare PDF API pricing?

Compare the cost of a successful document, the cost of a failed validation, the minimum plan, overage rates, storage, and the engineering time you would spend operating a browser fleet.

Can I test the API before committing?

Yes. ForkPDF has a browser playground with no signup and a free trial with 100 credits. Test the largest realistic document, not the demo.

Further reading

ForkPDF Engineering

ForkPDF is an HTML-to-PDF API with spatial layout introspection, self-healing layout tests, and PDF/A and PDF/UA output. The blog is written and reviewed by the ForkPDF team.

About the author →

Try the ForkPDF API

Generate a PDF, inspect every element's page and coordinates, and return a layout patch — in one API call.

100 free credits. No credit card required.