Blog
RelayPDF blog
Technical writing on the HTML to PDF API — HTML, Markdown, URLs, Office, REST, SDK, CLI, and MCP.
Guides
12 articles
URL to PDF when the page is behind login
A URL-to-PDF job is a public-web fetch. POST /v1/pdf with url tells RelayPDF’s Chromium to open that address from the worker network. Private, loopback, and metadata hosts are rejected (error code url_not_allowed). A login wall on a public host is still a public URL; the…
Queue a PDF with a pdf api webhook
To run a long PDF job without holding the HTTP connection, set response to async on any generating RelayPDF endpoint. The API returns 202 with a job id and pollUrl. Poll GET /v1/jobs/:id until status is completed or failed, or attach a pdf api webhook: optional callbackUrl on…
Handlebars PDF templates from JSON
Store a Handlebars layout once, publish it, then print a PDF with POST /v1/pdf and a JSON templateData object. That is the handlebars pdf template api on RelayPDF. templateId is the published UUID or slug. Optional templateVersion pins a published version. Optional strict…
Excel to PDF with an xlsx to pdf api
Use POST /v1/convert when the source is an Excel workbook. Send exactly one of html, url, or file. For a .xlsx (or .xls) file, send file as base64 plus sourceFilename with the real extension, and set to to pdf. LibreOffice is the default engine. Chromium on POST /v1/pdf does…
DOCX to PDF API
A docx to pdf api on RelayPDF is POST /v1/convert with a base64 .docx (or a local path through the SDK), sourceFilename ending in .docx, and to: pdf. LibreOffice is the default engine. Chromium on POST /v1/pdf does not open Word. Product page…
HTML to PDF charts
To get html to pdf charts that are not empty boxes, print after the canvas or SVG is actually drawn. Chart.js paints a canvas element. Highcharts injects an svg element. Both run after script load. POST /v1/pdf already waits for waitUntil (default networkidle0). That is a…
Wait for JavaScript when converting HTML to PDF
Chromium prints the page when the wait condition is met, not when your chart library feels finished. On RelayPDF the documented waits are options.waitUntil, options.waitForSelector, and options.waitForTimeout on POST /v1/pdf. waitUntil defaults to networkidle0. timeout is the…
HTML to PDF custom fonts
html is a UTF-8 JSON string, not Base64 of the document. The font file may still be a data URI inside CSS. Provide exactly one of html, url, markdown, or templateId. filename, if set, must end in .pdf. A published templateId can hold the same @font-face CSS; this post uses…
HTML to PDF page numbers
If you need html to pdf page numbers on RelayPDF, put them in options.footerTemplate (or headerTemplate) as empty spans with class pageNumber and class totalPages. That is the documented path. CSS counter(page) in the body HTML is a different print feature; Chromium’s print…
Page breaks and tables that split badly
An HTML to PDF page-break is not an API flag. RelayPDF prints your HTML with Chromium. Chromium paginates with CSS Fragmentation: break-inside, break-before, break-after, plus widows and orphans. Tables that split mid-row are almost always missing those rules, or they have a…
Headers and footers in an HTML to PDF API
Chromium does not print your document’s <header> or <footer> on every page. It prints a separate header/footer HTML fragment in the page margin. On RelayPDF that fragment is options.headerTemplate and options.footerTemplate on POST /v1/pdf. Set extra top and bottom margin or…
Markdown to PDF API
A markdown to PDF API is a POST that accepts GitHub-flavoured Markdown and returns a Chromium PDF. RelayPDF does that on POST /v1/pdf: you send a markdown field, the worker renders GFM to HTML, then Chromium prints it. Same print options as html. Same response modes. You do…
Compare
9 articles
RelayPDF vs DocRaptor
DocRaptor's homepage ( https://docraptor.com/, checked 23 Aug 2026) describes a REST HTML-to-PDF API whose PDF engine is Prince. They also convert HTML/XML tables to XLS and XLSX. Their own FAQ says they do not support zip or other file formats. Input is document_content or…
RelayPDF vs PDFShift
PDFShift is a hosted HTML-to-* API. You POST HTML or a URL, Chromium renders it, and you get a PDF, PNG, JPEG, or WebP. That is the product. RelayPDF is a PDFShift alternative when the rest of the pipeline is not HTML: GitHub-flavoured Markdown, Office files, merge and…
Self-host Gotenberg vs a managed PDF API
Gotenberg is a Docker HTTP API that wraps headless Chromium and LibreOffice. A managed PDF API is the same print job with someone else holding the process. The gotenberg vs api question is not print quality. Both can emit a Chromium PDF from HTML. The question is who owns…
PrinceXML vs Chromium for HTML to PDF
A web page is a scroll. A PDF is a stack of fixed rectangles. Prince's public user guide (Prince 14 Paged Media, https://www.princexml.com/doc/14/paged/ ) treats that stack as the primary layout. You name pages, select:first,:left,:right,:recto,:verso,:blank, and:nth(). You…
html2pdf.js vs a server HTML to PDF API
html2pdf.js is a browser library. It asks html2canvas to paint a DOM node onto a canvas, then asks jsPDF to embed that bitmap in a PDF.
Serverless Chromium on Vercel vs a PDF API
Stock Node print drivers download their own Chrome. Vercel published a walkthrough titled Deploying puppeteer with Next.js on Vercel ( https://vercel.com/kb/guide/deploying-puppeteer-with-nextjs-on-vercel, last updated 10 Nov 2025). It still tells you not to ship the full…
Playwright page.pdf vs a hosted HTML to PDF API
Playwright's page.pdf() prints the current page with Chromium's print CSS. You launch a browser, load HTML or a URL, wait until the page is ready, then write a buffer. That is the whole call. A hosted HTML to PDF API runs the same print path without a browser process on your…
Puppeteer vs a hosted HTML to PDF API
Keep Puppeteer when you need a real browser session. Use a hosted HTML to PDF API when you already have HTML (or Markdown, or a template) and the document is the product. RelayPDF is one of those APIs: POST UTF-8 JSON with html, a public url, markdown, or templateId to…
wkhtmltopdf alternatives in 2026
Stop installing the wkhtmltopdf binary for new work. The GitHub repo is archived, the last stable release is 0.12.6 (June 2020), and the engine is a Qt 4 WebKit fork the project’s own status page dates to 2012. For HTML you already own, print with Chromium: a hosted HTML to…
SDKs
6 articles
Generate PDFs in Laravel with a laravel html to pdf api
To generate a PDF in Laravel with a laravel html to pdf api, render a Blade view to an HTML string and send that string to RelayPDF. Do not install Chromium or wkhtmltopdf on the app host. The official PHP client is composer require relaypdf/relaypdf (PHP 8.1+, ext-curl…
HTML to PDF in Next.js
Do not run a browser binary on Vercel. For next.js html to pdf, print from a Route Handler that calls RelayPDF. The official client is @relaypdf/sdk. It maps to POST /v1/pdf. The print engine lives on the API host. Your App Router handler sends UTF-8 HTML (or a public URL…
HTML to PDF in PHP
To convert HTML to PDF in PHP with RelayPDF, call POST /v1/pdf with a UTF-8 html string. The documented html to pdf php api client is composer require relaypdf/relaypdf. That package wraps the same JSON field names as REST (html, filename, options, response). Methods are…
HTML to PDF in Python
The documented html to pdf python api path is pip install relaypdf, then client.pdf.from_html. The official client is stdlib-only (urllib), Python 3.10+, package 0.1.2 on PyPI as of 22 Aug 2026. You send UTF-8 HTML in JSON to POST /v1/pdf. Chromium runs on RelayPDF, not in…
HTML to PDF in Node.js
An html to pdf nodejs api is a typed HTTP client that sends HTML or a public URL to a hosted Chromium print and returns PDF bytes. In RelayPDF that client is @relaypdf/sdk. You construct RelayPDF with RELAYPDF_API_KEY, then call client.pdf.fromHtml or client.pdf.fromUrl…
HTML to PDF with curl
To turn HTML into a PDF with curl, POST JSON to https://api.relaypdf.com/v1/pdf. Send Authorization: Bearer pdf_live_... and Content-Type: application/json. Put the markup in html. Put a .pdf name in filename. Default response is binary: write the body with --output. That is…
PDF tools
7 articles
Generate a QR or barcode with a qr code api
Use POST /v1/barcodes when you need a QR or linear barcode as a PNG or SVG image. That is the RelayPDF qr code api. It returns an image. It does not stamp the mark onto a PDF. The live endpoint page says so in the first sentence: generate a QR or barcode image (PNG or SVG)…
HTML to PNG with an html to png api
Use POST /v1/images when you need a png, jpeg, or webp screenshot of HTML or a public URL. That is not a PDF. RelayPDF runs the same Chromium engine as POST /v1/pdf, then writes a bitmap instead of a print surface. Product page: https://relaypdf.com/screenshots. Field list…
Fill PDF form fields with a fill pdf form api
To fill PDF form fields with a fill pdf form api, list AcroForm names on POST /v1/pdf/form/fields, then write values on POST /v1/pdf/form/fill. Flatten is on by default. The product page states this is not OCR. The public surface is AcroForm only: it is not XFA and it does…
Password-protect a PDF via API
To password protect a PDF with the RelayPDF API, POST an existing PDF to /v1/pdf/protect with a required userPassword and an optional ownerPassword. The docs hub lists the job as password-protect with AES-256. The product page says the output remains standard PDF. This is a…
Watermark a PDF with a watermark pdf api
To watermark a PDF with a watermark pdf api, POST an existing PDF to /v1/pdf/stamp and send exactly one of text or image. The product page names this as a watermark for draft marks, confidential labels, or a logo. Position defaults to center. This is a PDF tool, not a…
Split or extract PDF pages with a split pdf api
To split or extract PDF pages with a split pdf api, POST one existing PDF to /v1/pdf/extract and name the pages you want to keep. The tools hub describes extract as “Split page ranges from one source PDF.” The product page is more precise: keep selected pages from one PDF…
Merge PDFs with an API
To merge PDFs with an API on RelayPDF, POST /v1/pdf/merge with a files array of two to twenty existing PDFs. Each item is a public url or a file payload (base64 in JSON; the SDKs accept bytes). Order in the array is page order in the output. The merge pdf api job is a PDF…
Use cases
8 articles
Add a Save as PDF button to a website
To add save as pdf to website UI in a SaaS app, keep the button in the browser and the print job on your server. The click POSTs a record id (or form state) to a route you own. That route builds a UTF-8 HTML document, calls POST /v1/pdf with a Bearer key, and sets response to…
Archive a webpage to PDF
To archive webpage pdf output from a live site, POST a public http(s) URL to /v1/pdf. Chromium loads that URL at request time and prints it. That is a snapshot of whatever the public host returned in that window, not a legal-hold archive, not a WORM store, and not a…
Export a dashboard or report to PDF
A dashboard is not an invoice. Cards load data after navigation. Canvas and SVG charts animate. Fonts arrive late. If you print on the first load event, you get empty tiles. That is a wait problem, not a missing OCR or screenshot feature. POST /v1/images is a bitmap of a…
Convert email to PDF with an eml to pdf api
To turn inbound email into one PDF with an eml to pdf api, POST the message to /v1/convert. Send file plus sourceFilename whose extension is .eml or .msg, and set to to pdf. LibreOffice is the default engine. Chromium on POST /v1/pdf does not open Office or email files…
Generate a shipping label or packing slip PDF
Use POST /v1/pdf as the shipping label pdf api. Send HTML or a published Handlebars template, then set a tight page with options.format or options.width plus options.height. Tracking marks are a second call: POST /v1/barcodes returns PNG or SVG; it does not stamp bars onto…
Generate contract PDF files from templates
To generate contract pdf output on RelayPDF you merge data into a published Handlebars layout (POST /v1/pdf with templateId and templateData) or you fill an existing AcroForm and flatten it (POST /v1/pdf/form/fill). That is the whole product surface for NDAs, offer letters…
How to generate certificate PDFs with the RelayPDF API
A certificate of completion is a one-page record: issuer, title, recipient, citation, date, and a credential identifier. LMS platforms, cohort bootcamps, and internal training tools emit one file per learner when a course marks complete. The file is not a signed legal…
Generate invoice PDFs from HTML
To generate an invoice PDF from HTML, POST /v1/pdf with exactly one source: html for a one-off document you already built, or templateId plus templateData for a published Handlebars layout. HTML is a UTF-8 JSON string, not Base64. The host is https://api.relaypdf.com. Auth is…
Integrations
3 articles
Generate PDFs in n8n with RelayPDF
Official n8n-nodes-relaypdf node for HTML, Markdown, URL, and published Handlebars templates. Binary PDF out for Gmail, Slack, and Drive.
Generate PDFs in Zapier with RelayPDF
To zapier generate pdf output with RelayPDF, add the official RelayPDF app in the Zap editor, connect a pdf_live_ key, and run Create PDF. Zapier owns the trigger and field mapping. RelayPDF owns Chromium and LibreOffice. The Zapier host does not run a browser. Create PDF…
HTML to PDF from a coding agent (MCP)
To do mcp html to pdf from a coding agent, install Node.js 20+, run npx @relaypdf/cli setup (device-flow login in the browser), then start the stdio server with npx @relaypdf/cli mcp. Point Cursor or Claude Desktop at that command. Call the pdf tool with html (or url…