PDFPipe

What you send / POST /v1/pdf with html

Render an HTML string to PDF over an API

Send a complete HTML document in the request body and get the PDF bytes back in the response.

What it is for

The default path. Your application already builds the markup, usually from a template engine it already has, and this posts that string and receives a file. The response is the PDF itself rather than a job id, so there is nothing to poll and nothing to reconcile: the request either returns bytes or returns an error.

The request

Sent to POST /v1/pdf with html. Everything else on this page is what happens around it.

bash
curl -X POST https://api.pdfpipe.xyz/v1/pdf \
  -H "Authorization: Bearer $PDFPIPE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "html": "<!doctype html><html><body><h1>Invoice</h1></body></html>",
    "options": { "format": "A4", "margin": "18mm" }
  }' \
  --output invoice.pdf

The actual limits

Read from the implementation rather than remembered, so these are the numbers the API enforces rather than the ones a roadmap intends.

  • The HTML string is capped at 5 MB. That is the markup, not the rendered page: a document referencing ten megabytes of images is fine, a document with those images inlined as data URIs is not.
  • Exactly one of html, url or template_id. Sending two is a 400 rather than a precedence rule you would have to remember.
  • The document is metered on success. A render that fails is refunded, so a broken template does not cost you documents while you fix it.

What failure looks like

A payload over the ceiling returns 413 with payload_too_large and a message naming the limit. Invalid JSON returns 400. A document that renders but produces nothing useful, such as one whose entire content is drawn by a script that never ran, returns 200 with a valid and blank PDF, which is the failure mode worth designing against because nothing reports it.

When this is the wrong tool

When the page already exists at a public address and is the same for every reader. Posting a five megabyte string that a URL render could have fetched is bandwidth spent for nothing. It is also the wrong shape when you need dozens of documents at once, because each render is a separate round trip.

Frequently asked

Is render html available on the free plan?

Yes. There is no plan gate on this one: it behaves the same on the free plan as on every paid plan, and the only limit that applies is the monthly document allowance.

Where do these numbers come from?

The running implementation. Every figure on this page, from payload ceilings to per-plan limits, is what the API enforces today rather than what a specification says it should. If one of them is wrong, the API is the thing to believe.

Related capabilities

Options that come up in the same request, and one from each of the other groups.

100 free documents a month, and a playground that runs a real render without a key.