Data as of Aug 16, 2026 · Based on 262 AI responses from ChatGPT Search and Google AI Mode · See how Parse measures this
If you need the strongest support for CSS print media queries and professional paged-media features, choose DocRaptor (uses the
Prince engine) for pixel-perfect PDFs. For quicker cloud HTML→PDF with modern CSS (flexbox, grid), use
PDFShift. If you require self-hosting and full infra control, run Gotenberg (Docker + Chromium).
Brands AI recommends here
Best when you need production-quality, print-focused PDFs: DocRaptor uses the Prince engine to honor @media print, paged-media rules, headers/footers and complex page breaks; expect higher setup/licensing tradeoffs.
Best for pixel-perfect print publishing and complex typography: Prince excels at advanced @page, footnotes and page floats for books/reports, but it often requires licensing and more integration work than browser-based services.
Best for web-native layouts needing fast cloud conversion: PDFShift is Chromium-based so it handles modern CSS, media queries, flexbox and grid quickly—but it may not match Prince for advanced paged-media precision.
Best when you need self-hosted Chromium rendering and full infrastructure control: Gotenberg runs in Docker for on-prem or private-cloud deployments, but requires DevOps effort to operate and scale.
Yes. I’d shortlist these based specifically on HTML → PDF + CSS @media print support:
| Service | Print CSS | Rendering engine | Best for |
|---|---|---|---|
| DocRaptor | Excellent | Prince | High-quality, print-oriented PDFs |
| PDFShift | Yes (use_print) | Chromium | Straightforward REST API |
| Browserless | Yes | Chrome/Chromium | Browser-accurate rendering |
| WeasyPrint | Excellent | Dedicated CSS layout engine | Self-hosting / open source |
If CSS print media queries are a hard requirement, DocRaptor is probably the strongest choice. It explicitly supports CSS media queries and uses print media by default; you can also select screen rendering through its API.
For example:
@media screen {
.download-button {
display: block;
}
}
@media print {
.download-button {
display: none;
}
.invoice {
font-size: 10pt;
}
}
DocRaptor also supports sophisticated paged-media CSS such as @page, custom page sizes, page breaks, headers/footers, page numbers, and printer's marks.
PDFShift is particularly attractive if you want a simple API and browser-like rendering. Its conversion API has an explicit use_print: true option to use the print stylesheet, along with CSS injection, JavaScript execution, custom page sizes, margins, etc.
Browserless is another good choice if your HTML depends heavily on modern Chrome behavior or JavaScript. Its PDF endpoint accepts either a URL or raw HTML and generates PDFs using Chrome's print engine; its documentation explicitly says the PDF operation uses the print CSS media type.
WeasyPrint is worth considering. It's open source and specifically designed around HTML/CSS-to-PDF rather than being a browser automation service. Its documentation says that, aside from documented exceptions, features applicable to print media are supported.
Bottom line:
If you tell me your language/framework (Node, Python, PHP, Ruby, .NET, etc.) and approximate PDF volume, I can narrow this down to the best 1–2 options, including pricing.
Here are top web results for exploring this topic:
PrinceXML·https://www.princexml.com Prince - Convert HTML to PDF with CSS Convert HTML documents to PDF. Beautiful printing with CSS. Support for JavaScript and SVG.
PDFreactor·https://www.pdfreactor.com PDFreactor - Convert HTML to PDF with CSS , typeset quality PDF Convert HTML to PDF with CSS Paged Media support. Professional printing with CSS, typeset quality PDF, accessible and PDF/A compliant. Aspose·https://forum.aspose.com**HTML** to PDF Conversion with @media print query - Aspose Forums Hi Aspose,. We have your .net HTML to PDF generator running in our web application. It appears to load embedded CSS, as it should. But the client wants a PDF only design, without affecting the web app
www.nutrient.io·https://www.nutrient.io/blog/top-ten-ways-to-convert-html-to-pdf/How to convert HTML to PDF : 10 best tools compared - Nutrient 3. Convert HTML to PDF using Puppeteer. Puppeteer logo — Node.js tool to convert HTML to PDF. Puppeteer(opens in a new tab) is a Node.js library from Google that controls Chrome or Chromium. It render
onesimpleapi.com·https://onesimpleapi.com/best/pdf-apis Best HTML to PDF APIs in 2026 (Compared) - OneSimpleApi.com OneSimpleAPI. Us. Simple HTML to PDF API with CSS injection and form filling. OneSimpleAPI offers a straightforward HTML to PDF conversion API with unique features like CSS injection and form filling.
Reddit·https://www.reddit.com Looking for a PDF generator that supports full HTML/CSS - Reddit I use this: https://pdfshift.io ... with great success. It is hosted, and has some cost to it, but very reliable and easy to work with. verdurakh. •. 4mo ago. We use Puppeteer + @ sparticuz/chromium w
DocRaptor·https://docraptor.com**HTML** to PDF API - High-Quality PDF Conversion with PrinceXML Free and powerful HTML to PDF converter with CSS Paged Media support. SOC2 and HIPAA compliant with guaranteed uptime.
Iron Software·https://ironsoftware.com The Definitive Guide to HTML to PDF Conversion Tools in 2026 The HTML to PDF landscape splits into five distinct tiers: browser-engine wrappers, commercial CSS engines, programmatic PDF builders, client-side converters, and cloud REST APIs. Each comes with a fu
APITemplate.io·https://apitemplate.io Online HTML to PDF Converter - APITemplate.io Our HTML to PDF tool easily convert HTML content, web pages, or URLs into high-quality PDFs. Whether you need to convert HTML code snippets or full web pages, our tool ensures perfectly formatted PDF
n8n Community·https://community.n8n.io Any recommendations for robust HTML to PDF conversion (handling ...Marian_Danas December 15, 2025, 7:50am 3. Hi @Michal_Liska , This is a perfect use case for the official PDF Generator API node, which is available directly in n8n. It has a dedicated action called HT
No sources cited
Yes. If HTML → PDF with CSS @media print support is the key requirement, I’d shortlist these:
| Service | Print CSS | Engine / approach | Best for |
|---|---|---|---|
| DocRaptor | Excellent | Prince | Complex, print-focused PDFs |
| PDFShift | Yes | Browser-style rendering | Easy API + modern web CSS |
| Gotenberg | Yes | Chromium | Self-hosting / control |
For a service specifically intended for document generation, DocRaptor is probably the strongest fit. It uses the Prince PDF engine and explicitly supports @media print; its API defaults to print media rules. It also has strong support for CSS Paged Media features such as @page, page breaks, headers/footers, page numbers, footnotes, and varying page layouts.
For example:
@media screen {
.print-only {
display: none;
}
}
@media print {
.screen-only {
display: none;
}
}
@page {
size: A4;
margin: 20mm;
}
DocRaptor can explicitly select the print stylesheet with:
{
"document_type": "pdf",
"document_content": "<html>...</html>",
"prince_options": {
"media": "print"
}
}
PDFShift is a good choice if you want something closer to a browser-based rendering workflow. It supports modern CSS, including flexbox and grid, and lets you inject CSS and JavaScript. It also supports supplying a dedicated CSS URL for PDF conversion, which is convenient for a print.css stylesheet.
Its free tier currently includes 50 credits/month, with paid plans for higher volume.
Bottom line:
If you tell me your language/framework (Node, Python, Ruby, PHP, .NET, etc.) and approximate PDFs/month, I can narrow this to the best option and show the exact API integration.
When looking for an HTML-to-PDF service that respects CSS print media queries (@media print ) and paged-media specifications (@page ), the market generally splits into two categories: Headless Browser/Chromium APIs (which simulate a browser print preview) and Dedicated Paged-Media Engines (which offer professional, textbook-grade pagination, running headers, and margin boxes).
Top cloud services and APIs categorized by their rendering approach include:
@page margin boxes, complex multi-page tables, and XML/HTML-to-PDF workflows without requiring you to manage local binaries.@media print , page counters, running headers/footers, and cross-references.emulate=print or configuring media type parameters) using an underlying automated Chromium architecture.@media print blocks (handling them just like hitting Ctrl+P or Cmd+P in Google Chrome), making them ideal if your print styles rely on standard web layout adjustments and hiding screen-only elements.To help narrow down the best fit, could you tell me:
@media print rules to hide/show elements and adjust fonts?Yes. If HTML-to-PDF with real CSS print media queries is the key requirement, I’d shortlist these:
| Service | HTML/CSS engine | @media print | Best for |
|---|---|---|---|
| DocRaptor | Prince | Yes | High-quality, production PDFs |
| Gotenberg | Headless Chromium | Yes | Self-hosted/open-source |
| Playwright/Puppeteer API | Chromium | Yes | Maximum browser compatibility |
| PDFShift | Chromium-based | Yes | Simple hosted API |
DocRaptor is probably the strongest choice if you want a managed API. It explicitly supports CSS media queries, renders using the print media type by default, and has particularly strong support for paged-media CSS such as @page, page breaks, headers/footers, and print-specific layouts.
If you want self-hosting, Gotenberg is an excellent alternative. It uses Headless Chromium, defaults to print media, supports @media print, @page, CSS page sizing, and lets you explicitly choose emulatedMediaType=print or screen.
For example, your HTML can contain:
@media screen {
.pdf-only {
display: none;
}
}
@media print {
.navigation {
display: none;
}
.invoice {
color: #000;
}
}
@page {
size: Letter;
margin: 0.5in;
}
If you tell me your expected volume, language/runtime (Node, Python, Java, etc.), and whether you need a hosted API or self-hosting, I can narrow this to the best 2–3 options and compare pricing, CSS support, and API ergonomics.
When looking for an HTML-to-PDF generation service that properly interprets CSS print media queries (@media print ) and the broader CSS Paged Media standards (@page , page breaks, running headers), your choices generally fall into three categories: dedicated Paged Media Engines (via API), Headless Browser APIs , or Self-Hosted tools.
Top options available for this workflow include:
@media print, @page rules, generated content for headers/footers, and complex multi-page layouts.emulate=print ) via simple REST parameters.To help narrow down the best fit , could you tell me:
Yes. If CSS print media queries are a hard requirement, I’d focus on services that render with a real browser or a print-focused CSS engine.
| Service | HTML/CSS | @media print | JS | Best for |
|---|---|---|---|---|
| HTMLPDF.dev | Chromium | ✅ | ✅ | Simple hosted API |
| PDFShot | Chromium | ✅ | ✅ | Pixel-accurate web pages |
| pdfRelay | Chromium | ✅ | — | PDFs with accessibility/archival features |
| PDFBroker / WeasyPrint | WeasyPrint | ✅ | ❌ | Print-focused documents |
| WeasyPrint | Open source | ✅ | ❌ | Self-hosting |
My first choice: urlHTMLPDF.devturn0search4. It explicitly supports switching between CSS print and screen media types, uses pooled headless Chromium, and accepts either raw HTML or a URL.
For example, your CSS can use:
@media print {
.no-print {
display: none;
}
.page-break {
break-before: page;
}
@page {
size: Letter;
margin: 0.5in;
}
}
If you need browser-level fidelity—JavaScript, modern Flexbox/Grid, web fonts, etc.—urlPDFShotturn0search3 is another strong fit; it specifically advertises CSS3, Flexbox, Grid, media queries, print styles, and JavaScript rendering.
If your documents are more like invoices, reports, or contracts and you don't need JavaScript, WeasyPrint is particularly well suited because its layout engine is specifically focused on print standards, pagination, and CSS.
Bottom line:
When looking for an HTML-to-PDF service that supports CSS print media rules (@media print ) and pagination control, options generally fall into two categories: Headless Chromium-based APIs (which emulate a browser's print engine) and Dedicated Paged-Media Engines (which give you absolute, print-grade control via specialized CSS modules).
The top services handling these workflows vary by your exact requirements:
@media print , advanced page breaks, running headers/footers, and margins using pure CSS without relying on a web browser hack. You can explore their capabilities directly on the DocRaptor HTML to PDF API page.@media print blocks, custom print stylesheets, and modern layout features like Flexbox or Grid. They are straightforward, developer-friendly REST endpoints if your print styling isn't overly complex. Check out options like the PDFCrowd HTML to PDF API for quick implementation.To help narrow down the best choice, tell me:
When looking for a cloud service or API that converts HTML to PDF while fully honoring CSS print media queries (@media print ) and advanced paged media, the options generally fall into two categories: Dedicated Print-Engine APIs (which offer the highest fidelity for print rules) and Headless Browser APIs (which use Chromium and let you toggle the media type emulation).
Top-tier services that explicitly support print styling include:
@page, @media print , complex multi-page layouts, running headers/footers, and precise pagination).screen and print media emulation in the API request.If you can share:
I can help you narrow down the best service and estimate costs.
If your main requirement is accurate HTML-to-PDF rendering with CSS print media queries (@media print), you should choose a service backed by a modern Chromium rendering engine. These generally provide the best compatibility with modern CSS (Flexbox, Grid, custom fonts, @page, page breaks, etc.).
Here are some strong options:
| Service | Print CSS Support | Notable Features | Good For |
|---|---|---|---|
| urlHTMLPDF.devturn0search1 | ✅ Full @media print or screen mode | Chromium-based, headers/footers, page size, fast API | General-purpose PDF generation |
| urlpdfRelayturn0search3 | ✅ Full print stylesheets | Accessibility (PDF/UA), PDF/A, encryption, custom page settings | Enterprise documents |
| urlPDFShotturn0search0 | ✅ Media queries and print styles | HTML, URL, JavaScript rendering, custom margins | Dynamic web pages |
| urlPresaturn0search4 | ✅ Chromium with @page support | Based on Gotenberg/Chromium, Node/Python/Go SDKs | Developers wanting predictable rendering |
| urlHTML2PDF.app Documentationturn0search7 | ✅ Chromium rendering | Supports HTML, CSS, JavaScript and selectable media mode | Straightforward REST API |
All of these advertise support for modern Chromium rendering, including CSS print features.
For document-heavy applications (invoices, reports, labels), it's worth confirming the service supports:
@media print@page rulesbreak-before, break-after, break-inside)printBackground)If you're building a SaaS product and need high-fidelity document output, I'd recommend choosing a Chromium-based service over one that uses older rendering engines, as Chromium offers the broadest compatibility with modern HTML and CSS.