HTML to PDF

Turn application HTML into a real PDF

Invoices, receipts and reports can go straight from your template to PDF, with no temporary public URL in between.

Capture settings
Enter the source, choose your options, then run the capture.
Result
Your capture will appear here and stay in view.
waiting

No result yet

Complete the settings and run the tool. Images, PDFs, text, and video all preview in this panel.

Send this exact request
cURL, TypeScript and Python are generated from the same configuration as the demo.
curl --fail-with-body "https://api.pagecapture.dev/v1/take" \
  -H "X-Access-Key: $PAGECAPTURE_KEY" \
  -H "Content-Type: application/json" \
  --data '{"html":"<article style=\"font: 16px system-ui; padding: 32px\"><h1>Invoice 1042</h1><p>Total: $125.00</p></article>","format":"pdf","pdf_paper_format":"a4","pdf_print_background":true}' \
  -o capture.pdf

No temporary hosting

The document travels in the POST body and is rendered from a controlled origin.

Selectable text

Chromium prints a PDF; it does not wrap a screenshot inside a page.

Print CSS

Use page-break rules, paper size and margins from the same request.

Background control

Keep CSS backgrounds when the document design depends on them.

Use this when
  • Invoices, reports or receipts are assembled from application data.
  • The caller controls print CSS and page-break rules.
Do not use this when
  • The source of record is a hosted page that should be captured by URL.
  • A document library can generate the required PDF without HTML.
Workflow

From input to verified artifact

  1. 01

    Submit HTML

    POST the document body, styles and PDF options.

  2. 02

    Apply print layout

    Chromium lays out paper size, margins, backgrounds and page breaks.

  3. 03

    Return PDF

    The response is a real PDF with selectable text and links.

Edge cases and common errors

Unexpected page break

Use print CSS break rules and test with the same paper size as production.

Background is missing

Enable pdf_print_background when the document relies on CSS backgrounds.

DIY in hours and operational risk

Keep the browser when that is the simpler system.

A server-side PDF library is often better for simple documents with no browser CSS dependency.

DIY is a good fit when

  • The document format is fixed and a native PDF library already covers it.
  • You require PDF features Chromium does not expose.

No default is supplied: we do not invent engineering-hour savings.

Responsibility and risk transferred
Chromium packaging
Serverless images can omit the browser or required system fonts.
Print regressions
Browser upgrades can alter pagination without fixture coverage.
Workload pricing

1,000 generated PDFs

This is an editable scenario, not a savings claim. Only successful captures that miss cache are billable.

Billable successes
990
Smallest included plan
Basic
Published monthly price
$10.00
Tested and reviewed

Written by PageCapture Engineering. Reviewed by PageCapture API maintainers. Last tested 2026-08-11.

cURL, TypeScript and Python executed against controlled fixtures; request contract and artifact format verified.

Questions this raises

Can I control page breaks?

Yes. Use print CSS break rules in the HTML or injected styles and test them at the production paper size.

Is this different from URL to PDF?

Yes. HTML to PDF accepts caller-owned markup directly; URL to PDF navigates to an already hosted page.

Why is a background missing?

Set pdf_print_background=true. Browsers omit print backgrounds unless asked to preserve them.