Comparison
A server-side alternative to html2pdf.js
html2pdf.js works by running html2canvas in the browser to take a screenshot of the DOM, then embedding that screenshot as a raster image inside a PDF. The result is blurry at non-screen DPI, text is not selectable or searchable, file sizes are large, and the quality degrades when the page has responsive breakpoints or complex layout. PDFPipe renders your HTML with a real browser engine and produces a true vector PDF from the server.
html2pdf.js versus a dedicated PDF API
| PDFPipe | html2pdf.js | |
|---|---|---|
| Rendering method | Native PDF from browser engine | Canvas screenshot embedded as image |
| Text in output | Vector, selectable, searchable | Rasterized image, not selectable |
| Print quality | Crisp at any DPI, print-ready | Blurry above screen resolution |
| File size | Small (vector text, compact) | Large (PNG/JPEG embedded per page) |
| CSS support | Complete, including print rules | Limited by canvas capture |
| Runs on | Server (one API call) | User's browser |
| Page breaks | Honored via CSS print rules | Manual or unreliable |
| AI agents | First-class MCP server | Not applicable |
The screenshot-to-PDF problem
html2canvas captures the visible DOM at screen resolution (72-96 DPI). When that image is embedded in a PDF and the recipient prints it at 300 DPI or zooms in, text and fine details become pixelated. Invoices and contracts printed this way look unprofessional. PDFPipe generates a real PDF with vector text: every character is crisp regardless of zoom level or print DPI, and the file is 5-10x smaller.
Text selection and accessibility
An html2canvas-based PDF contains images, not text. The reader cannot select an order number, copy an email address, or use Ctrl-F to search the document. Screen readers cannot read it. PDFs generated by PDFPipe contain real selectable text, pass PDF/A accessibility checks, and work correctly in every PDF viewer.
One request, real output
// Server-side: your HTML template becomes a real PDF
const html = renderOrderConfirmation(order);
const res = await fetch("https://api.pdfpipe.xyz/v1/pdf", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.PDFPIPE_API_KEY}` },
body: JSON.stringify({ html, options: { format: "A4" } }),
});
// res.body is a vector PDF: text selectable, print-ready, small file.
const pdf = await res.arrayBuffer();When to keep html2pdf.js
html2pdf.js is useful when you genuinely need to capture an exact visual snapshot of a page as it appears in a specific browser: preserving a dashboard screenshot, capturing a user-edited diagram, or archiving a rendered visualization. For anything that will be printed, shared as a document, or needs selectable text, a server-side render API produces far better results.
Try it on the live playground with no signup.
See pricing →