Features

HTML to PDF API features

Every document operation behind one bearer key.

Use RelayPDF when you need to render, screenshot, convert, or manipulate documents without shipping Chromium or LibreOffice yourself. One bearer key covers REST, official SDKs, the CLI, and MCP.

HTML to PDF API that converts HTML, Markdown, URLs, and Office files to production PDFs. PDF tools (merge, protect, stamp, forms) are dedicated endpoints after generation.

HTMLMarkdownURLDOCX
RELAYPDF
REST · SDK · CLI · MCP
PDFPNGQR
Chromium PDF rendering
POST HTML, a URL, GitHub-flavoured Markdown, or a published Handlebars template. Choose page format (A0–A6, letter, legal, tabloid, ledger), landscape, scale from 0.1 to 2, CSS page size, and margins. Print background is on by default.
Screenshots
The same engine renders HTML or a URL to png, jpeg, or webp — full page or viewport, with optional clip region, quality, omit-background, and device scale factor.
Handlebars templates
Store reusable HTML in the dashboard or Template API. Browse the public stock gallery, clone a layout, draft and publish versions, pin templateVersion, and generate first drafts with AI. Conversion uses the same API key as POST /v1/pdf.
Office conversion
LibreOffice converts Word, Excel, PowerPoint, ODF, RTF, CSV, images, and .eml/.msg email to PDF, DOCX, XLSX, HTML, or a PNG thumbnail. wkhtmltopdf handles HTML or URL to PDF with an optional table of contents.
PDF tools
Worker-native operations: merge, extract, protect, unlock, stamp, rotate, delete pages, compress, bookmarks, images-to-PDF, form fill, plus barcodes and zip. Raster uses the document worker.
Barcodes and zip
Generate qr, code128, code39, ean13, upca, pdf417, and datamatrix as PNG or SVG with optional human-readable text. Bundle up to 30 named files into a zip.
Response modes and jobs
Every generating endpoint accepts binary, url, or async. Async returns a poll URL; url returns a public 24-hour download link you can hand straight to a browser.
Signed webhooks
Register HTTPS endpoints and receive job.completed, job.failed, and wallet events signed with HMAC-SHA256. Official SDKs verify signatures for you.
CLI and SDKs
@relaypdf/cli covers every endpoint from the shell. Official SDKs (Node, Python, PHP, C#, Java) share the REST field names, with typed errors and save helpers.
n8n node
n8n-nodes-relaypdf is the official community node: HTML, Markdown, URL, and published templates to PDF, Office convert, merge, barcodes, and a signed webhook trigger. Default output is binary field data for Gmail, Slack, and Drive.
MCP for coding agents
relaypdf mcp exposes pdf, image, convert, merge, extract, protect, raster, stamp, info, text, form, barcode, zip, templates, and job tools over stdio for Cursor and Claude. HTML and file contents are never logged.
POST /v1/convert

The conversion matrix.

Source is exactly one of html, url, or a base64 file with a sourceFilename extension. LibreOffice is the default engine; wkhtmltopdf is opt-in for HTML and URL sources. If the container is cold or unreachable you get a 503 convert_unavailable — and you are not billed for it.

Write burst
5 / 10 seconds
Trial writes
20 / minute
Funded writes
60 / minute
File downloads
60 / minute / IP
SourceTarget
Word · ODT · RTF · TXT · HTMLPDF · DOCX · HTML
Excel · ODS · CSVPDF · XLSX
PowerPoint · ODPPDF
PNG · JPEG · GIF · TIFF · BMP · WebPPDF
Email (.eml, .msg)PDF
PDFHTML · PNG thumbnail
PDF tools

Manipulation without a render.

Each input can be a public URL, a temporary RelayPDF file URL, or base64 bytes. Uploads and fetches are capped at 15 MB, and these operations debit only $0.005 each.

Browse PDF tools →
POST /v1/pdf/mergeCombine 2–20 PDFs into one document
POST /v1/pdf/extractKeep page ranges ("1-3,5" or an array); duplicates collapsed
POST /v1/pdf/protectAES-256 user password, with optional owner password
POST /v1/pdf/unlockRemove a user password
POST /v1/pdf/bookmarksAdd up to 200 outline items with 1-indexed page targets
POST /v1/pdf/rasterRender pages to PNG or JPEG (zip if multiple); needs document worker
POST /v1/pdf/from-imagesPNG/JPEG images to a PDF, one image per page
POST /v1/pdf/stampText or image watermark
POST /v1/pdf/rotateRotate pages by a multiple of 90°
POST /v1/pdf/delete-pagesRemove page ranges; at least one page must remain
POST /v1/pdf/compressLossless rewrite (no image downsample)
POST /v1/pdf/infoPage count, encryption, metadata JSON
POST /v1/pdf/textExtract the existing text layer (no OCR)
POST /v1/pdf/form/fillFill AcroForm fields and flatten
POST /v1/barcodesQR and 6 barcode symbologies as PNG or SVG
POST /v1/zipBundle up to 30 named files, names uniqued
Jobs and delivery

Long renders should not block your request.

Set response to async and you get a 202 with a poll URL. Add a callbackUrl for a fire-and-forget POST when the job finishes, or register a dashboard webhook to get signed events for every job and wallet change.

  • binary — file bytes with x-relaypdf-id and content-disposition
  • url — JSON with a 24-hour download link and expiresAt
  • async — 202 with pollUrl; GET /v1/jobs/:id until completed
report.tsNode SDK
// async: get a job back, keep your request short
const job = await client.pdf({
  url: "https://example.com/report",
  filename: "report.pdf",
  response: "async",
  callbackUrl: "https://api.acme.com/hooks/relaypdf",
});

const done = await client.jobs.wait(job.id);
console.log(done.url); // public for 24 hours

Ready to integrate?

Start with the quickstart, or talk to us about committed-volume rates if you are pushing a million documents a month.