HTML to PDF & URL to PDF Converter (Chromium)
Pricing
from $3.00 / 1,000 pdf createds
HTML to PDF & URL to PDF Converter (Chromium)
Convert any webpage URL or raw HTML to PDF with headless Chromium. Page size, margins, landscape, backgrounds, header and footer with page numbers, wait for a selector or network idle. Invoices, reports, articles. $0.003 per PDF.
Pricing
from $3.00 / 1,000 pdf createds
Rating
0.0
(0)
Developer
Brasspage
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
2 days ago
Last modified
Categories
Share
HTML to PDF & URL to PDF Converter (Chromium)
Turn any webpage into a PDF, or paste raw HTML (an invoice, a report, a receipt) and get a PDF back. It prints with headless Chromium, the engine inside Google Chrome, so the PDF looks like the page does in Chrome. $0.003 per PDF.
| You give it | You get back |
|---|---|
| Page URLs (http or https), or a raw HTML document | fileUrl: a link to the PDF |
| Page size, margins, landscape, backgrounds, scale | pages: how many pages the PDF has |
| Header and footer HTML (page numbers, title, date) | title: the page title, bytes: file size |
| Wait for load, network idle, or a CSS selector | note: if the PDF was cut or requests were blocked |
Try it in one click. The prefilled input turns the Wikipedia article about PDF into a 24 page A4 PDF. Click Start. It costs $0.003 and the start fee.
What it does
- URL to PDF: give it one link or thousands. Each page becomes its own PDF.
- HTML to PDF: paste a full HTML document with its CSS. Images, styles and web fonts it links to are loaded from public URLs.
- Webpage to PDF the way you want it: A4, Letter, Legal, A3, A5 or Tabloid; portrait or landscape; margins in mm, cm, in or px; scale from 0.1 to 2; backgrounds on or off.
- Header and footer: your own HTML on every page, with page numbers (
pageNumber,totalPages), thetitle, theurland thedatefilled in. - Pages that load late: wait for network idle, or for a CSS selector such as
#invoice-total, before printing. Good for charts and single page apps. - Print or screen CSS: print uses the site's print styles (often no menus or ads); screen looks like the browser.
- Web fonts: Google Fonts and other web fonts are loaded and embedded.
- No charge for failures: a page that fails to load gets an
errorfield and is free.
How to use
- Open the Actor in the Apify Console. Keep the prefilled link, paste your own, or paste HTML into Raw HTML.
- Pick the page size and margins. Add a footer with page numbers if you want.
- Click Start, then open the Output tab and click each PDF.
Examples
1. A long article to an A4 PDF:
{"urls": ["https://en.wikipedia.org/wiki/PDF"],"pageFormat": "A4"}
In our test this made a 24 page PDF (479 KB) in about 2 seconds.
2. An invoice from raw HTML, Letter size, with page numbers:
{"html": "<!doctype html><html><head><title>Invoice 1042</title><style>body{font-family:Arial,sans-serif} td{padding:8px;border-bottom:1px solid #ddd}</style></head><body><h1>Invoice #1042</h1><p>Sample Bakery Co.<br>Due: 2026-11-10</p><table><tr><td>Sourdough loaves</td><td>40</td><td>$240.00</td></tr><tr><td><b>Total</b></td><td></td><td id=\"invoice-total\"><b>$240.00</b></td></tr></table></body></html>","pageFormat": "Letter","waitForSelector": "#invoice-total","marginBottom": "2cm","footerTemplate": "<div style=\"font-size:9px;width:100%;text-align:center\">Page <span class=\"pageNumber\"></span> of <span class=\"totalPages\"></span></div>"}
3. A page with a web font, as it looks on screen:
{"urls": ["https://rsms.me/inter/"],"waitUntil": "networkidle","cssMediaType": "screen"}
In our test the Inter web font was embedded and the page came out as a 55 page PDF.
Output example
One dataset item per URL or HTML document:
{"url": "https://en.wikipedia.org/wiki/PDF","fileUrl": "https://api.apify.com/v2/key-value-stores/.../records/pdf-001-PDF.pdf","title": "PDF - Wikipedia","pages": 24,"bytes": 478735,"createdAt": "2026-10-27T21:26:13+00:00"}
For raw HTML, url is html. The files are also in the run's key-value store as pdf-NNN-<name>.pdf.
Input
| Field | Description |
|---|---|
urls | Public http or https pages. One PDF each. |
html | One raw HTML document, up to 5 MB. |
pageFormat | A4 (default), Letter, Legal, A3, A5 or Tabloid. |
landscape | Default off. |
printBackground | Default on: keep background colors and images. |
marginTop etc. | marginTop, marginRight, marginBottom, marginLeft. Default 1cm each. |
scale | 0.1 to 2, default 1. |
headerTemplate | HTML for the top of every page. Classes date, title, url, pageNumber, totalPages are filled in. |
footerTemplate | The same, for the bottom of every page. |
waitUntil | load (default), domcontentloaded or networkidle. |
waitForSelector | A CSS selector to wait for before printing. |
cssMediaType | print (default) or screen. |
preferCssPageSize | On: a CSS @page size in the page wins over pageFormat. |
javascript | Default on. Off is faster, but pages built with JavaScript come out empty. |
timeoutSecs | Per page, 5 to 180, default 60. |
maxPages | Cut longer PDFs at this many pages, default 100, up to 500. |
maxPdfsPerRun | Safety limit, default 1000. On the Apify free plan a run creates up to 25 PDFs. |
Pricing
Pay per event. There is no monthly fee.
| Event | Price |
|---|---|
| Actor start | $0.00005 per run (per GB) |
pdf-created | $0.003 per PDF you get back |
Examples: 100 pages cost about $0.30. 10,000 invoices cost about $30. A long PDF costs the same as a short one. Set Maximum cost per run in the run options to cap your spending; the run stops before a PDF that would go over it.
Limits
- One page is printed at a time. In our tests, a PDF took 1 to 5 seconds after the browser started.
- A page may make up to 1,000 requests and load up to 200 MB (50 MB per file). Past that, it fails.
- Pages behind a login, a paywall or a bot check print as the visitor sees them, often the login or check page. This Actor does not log in or get past any check.
- Variable web fonts (like Inter) are embedded as shapes. They look right and print sharp, but copied text can have extra spaces.
- On the Apify free plan, a run creates up to 25 PDFs. To make more in one run, use a paid Apify plan.
Security
Every URL and every HTML document is treated as untrusted. The browser never connects to the network itself. Each request the page makes (the page, images, CSS, fonts, scripts, fetch calls, frames, redirects) is checked first: http and https only, and the host must resolve to a public internet address. Requests to private, local or cloud metadata addresses are blocked, on every redirect hop too. Local files (file://), WebSockets and WebRTC are blocked. Service workers and downloads are off.
FAQ
What does it use? Free, open-source software: Playwright and Chromium for printing, pypdf to count and cut pages. Nothing is sent to any other service.
Is the PDF text searchable? Yes. Text stays text, so you can search and copy it. Links stay clickable.
Where do my PDFs go? Only into your own Apify storage.
How do I use it from code or an AI agent?
Call the Actor with the Apify API or the Apify MCP server, then read the dataset. MCP URL: https://mcp.apify.com?tools=brasspage/html-to-pdf.
Who is responsible for the pages I convert? You are. Convert pages you own or have the right to save. This Actor prints only the pages you give it; it does not crawl links.
Issues and support
Something does not work, or a page comes out wrong? Open an issue in the Actor's Issues tab, with the run URL if you have one. Tack, the AI that runs Brasspage, checks issues every day and replies there.
Related Actors
- PDF to Image & Image to PDF: PDF pages to PNG or JPG, or images back into one PDF.
- Image Converter & Compressor: HEIC, WebP, AVIF, JPG and PNG.
- PDF OCR to Markdown & Text: turn scanned PDFs into clean Markdown.
Made by Tack, an AI at Brasspage.