Free developer playground · No signup

HTML to PDF converter and playground

Paste HTML, CSS, JavaScript, and template data. Generate a PDF with the Fork PDF engine, choose a generation region, and optionally run a synchronous test case for self-healing.

5 generations per IP every 24 hours No PDF storage

Example: self-healing invoice

The example includes CSS, JavaScript, template data, and a test case. Use Start blank for your own document. Demo requests are limited to 5.5 MB.

Free demo quota 5 generations per IP every 24 hours.

Preview

Your generated PDF will appear here. Nothing is uploaded until you press Generate.

Convert HTML to PDF without leaving the browser

This playground runs the same synchronous PDF generation path used by the Fork PDF API. Paste a document, add print CSS, and optionally run JavaScript before printing. The generated PDF is returned directly to your browser.

How it works

  1. Paste your source. Use the HTML, CSS, JavaScript, Template data, and Test case tabs.
  2. Choose output options. Select PDF or ZIP, a standard or custom page size, per-side margins, media type, a compliance preset, and a font policy.
  3. Generate and download. The selected region renders the PDF and returns it directly. No PDF record is stored.

Test print CSS

Use @page, page breaks, tables, web fonts, and print media queries. The preview is the generated PDF, not a separate HTML approximation. Page size supports standard formats or custom width and height, with per-side margins in px, mm, cm, or inches.

Test PDF/A and PDF/UA

Choose a PDF/A-2/3/4 flavor, PDF/UA-1/2, or a supported combination. The result panel reports font embedding, font policy, PDF/A flavor, and PDF/UA version from the response headers. PDF/A is stable; PDF/UA remains experimental.

Choose a region

Auto picks the nearest available region. You can override it to test latency from Mumbai, Cape Town, N. Virginia, Ireland, Sydney, or São Paulo.

Template data and synchronous self-healing

The Template data tab accepts a JSON object. The HTML uses Nunjucks placeholders such as {{ company }} and {{ item.amount }}, so one document can generate many variants without editing the markup. The Test case tab runs after layout with the spatial document available as doc. Return { success: true } to accept the PDF, or return a patch object to merge new values into the template data and re-render. The engine retries twice, synchronously, before returning an error.

Demo vs API

CapabilityBrowser demoFork PDF API
SignupNot requiredAPI key and project
RequestsSynchronous onlySync, webhooks, templates, stored PDFs
Limits5 per IP every 24 hoursPlan-based
Use caseTesting and prototypesProduction integrations

Use the same example with the API

The API supports the same synchronous request with an API key and project ID, plus webhooks, templates, and stored PDFs.

curl -X POST "https://api.forkpdf.com/v1/generate-pdf" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "x-project-id: YOUR_PROJECT_ID" \
  -H "Content-Type: application/json" \
  -d '{
    "htmlContent": "<h1>Hello from Fork PDF</h1>",
    "format": "A4",
    "compliance": { "pdfUa": 2 }
  }'
const response = await fetch('https://api.forkpdf.com/v1/generate-pdf', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'x-project-id': 'YOUR_PROJECT_ID',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    htmlContent: '<h1>Hello from Fork PDF</h1>',
    format: 'A4',
    compliance: { pdfUa: 2 }
  })
});

Free demo limits

The browser tool allows 5 generations per IP address every 24 hours. The per-IP window is rolling: it starts with your first generation. No signup or API key is required for the demo.

What happens to my HTML?

The demo sends your HTML, CSS, and JavaScript to the selected Fork PDF generation region and returns the PDF or ZIP directly. It does not create a PDF record, does not store the output, and does not send the request through the authenticated API queue path.

Frequently asked questions

Is the HTML to PDF converter really free?

Yes. The demo is free without an account. The 5-per-IP limit keeps it available.

Why is there a limit?

PDF generation uses a headless browser and consumes compute. The limit protects the demo from abuse and keeps it free.

Does JavaScript run?

Yes. The JavaScript tab runs in the PDF engine before generation. Keep scripts self-contained and deterministic.

Does it support template data and self-healing?

Yes. Add a JSON object in the Template data tab and use Nunjucks placeholders in the HTML. The Test case tab runs after layout; return { success: true }, or { success: false, patch: { ... } } to patch the template data and re-render synchronously.

Can I use the API instead?

Yes. The API supports the same synchronous generation model plus webhooks, templates, and project storage. See the generate PDF API reference and the compliance capability matrix.

Can I generate PDF/A or PDF/UA?

Yes. Choose PDF/A-2/3/4, PDF/UA-1/2, or a supported combination in the Compliance selector. PDF/A is stable and machine-validated. PDF/UA remains experimental until the human accessibility audit.

What is strict font policy?

Strict font policy rejects external stylesheets, non-inline @font-face rules, and system-font fallback. Use it when every glyph must come from a caller-supplied inline font. The default warn policy reports warnings without blocking generation.

Does the demo store my document?

No. The demo returns the generated file directly and does not store the PDF. Rate limiting stores only a salted IP hash and counters.

Can I set custom page sizes and margins?

Yes. Choose a standard page size or enter custom width and height. Each margin can use millimetres, centimetres, inches, or pixels.

What is the difference between the demo and the API?

The demo is a synchronous browser playground with no signup. The API adds API keys, projects, templates, higher limits, webhooks, and stored PDFs.

Related documentation

Start a blank document?

This clears the example HTML, CSS, JavaScript, template data, test case, and current preview.