HTML to PDF & URL to PDF Converter - Bulk, Headless Chrome
Pricing
from $2.40 / 1,000 documents
HTML to PDF & URL to PDF Converter - Bulk, Headless Chrome
Turn web page links or raw HTML into PDF files in bulk with headless Chrome: A4/Letter, margins, landscape, backgrounds, header and footer with page numbers. Results are files with public links.
Pricing
from $2.40 / 1,000 documents
Rating
0.0
(0)
Developer
Northbell
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
a day ago
Last modified
Categories
Features
Share
Turn web page links or raw HTML into PDF files in bulk. Give it URLs (or a dataset from another Actor, or a piece of HTML) and get one PDF per input as a file with a public link, one dataset row per input. It prints with headless Chrome, so the PDF looks like Chrome's own "Save as PDF": A4, Letter, Legal or A3, margins, landscape, background colours, a header and footer with page numbers, and a wait for a selector for pages that load with JavaScript. One bad page never fails the run: it becomes a row with a plain error message, and the rest carry on.
Try it now - the input is already filled in. Press Start. It converts example.com and RFC 1149 (rfc-editor.org) to A4 PDFs with a "page / total pages" footer. In our own local run with this input (Windows, Chromium 159, 2 pages at a time): 2 PDFs, 3 PDF pages, 67,595 and 30,812 bytes, about 8 seconds for the whole run including browser start. That is $0.006 (plus $0.00005 for the run start).
What you pay
| Event | Price | When |
|---|---|---|
pdf | $0.003 | per PDF stored |
apify-actor-start | $0.00005 | once per run |
- You are charged for a PDF only after it is saved. Errors, rejected links, bot-check pages and pages skipped by "Only changed" are free.
- Set "Maximum total charge" on the run as your cap. The Actor checks the charge limit before it stores each PDF and stops cleanly when the next one does not fit.
Built so that runs finish
- A timeout on every page. 60 seconds by default (
timeoutSeconds, 5 to 300). A page that does not load becomes an error row, and the browser tab is closed. - Errors are rows.
status: "error"and a sentence that says why: "The server answered 404.", "The page did not finish loading within 60 seconds.", "The element given in Wait for selector did not appear...". The run still ends as succeeded. - Downloads are blocked. A link that is a file (a ZIP, or a PDF that Chrome would download) is an error row, not a download.
- Bounded parallelism. 2 pages at a time by default, up to 5 (
concurrency). The default fits the 2048 MB the Actor starts with. - Honest browser. It identifies as Chrome with " html-to-pdf (Apify Actor)" added to the user agent. No proxies, no stealth or anti-bot plugins. If a page answers with a bot check (Cloudflare "Just a moment", Turnstile or hCaptcha only), the row says "the page asked for a bot check; this tool does not get around it", free.
Run it after your scraper
If another Actor collects page links (a news scraper, a blog or documentation crawler, a search results scraper), this Actor can archive every page as a PDF after each of its runs:
- In Apify Console, open that Actor and go to Integrations.
- Add Run Actor (on "Run succeeded") and pick this Actor.
- Use an input like this, with the name of the field that holds the page link:
{"datasetId": "{{resource.defaultDatasetId}}","urlField": "url","format": "A4","onlyChanged": true,"maxItems": 200}
A dotted path such as page.url reaches into nested fields; the field may hold one link or a list of links. If the dataset has no links, nothing runs and nothing is charged. Each output row keeps a small sourceItem (the field name, the link and the row's id if it has one) so you can match PDFs to the original rows.
Run it on a schedule with only changed pages
Turn on onlyChanged and schedule the run. The Actor keeps a hash of each page's visible text in a key-value store named html-to-pdf-seen in your account. On the next run:
- the text is the same:
status: "skipped",changed: false, no PDF, free; - the text is different: a new PDF with the date in its file name (
...-2026-11-22.pdf),changed: true; - the page was not seen before: a PDF,
changed: null(nothing to compare with).
Only the text you can read is compared (extra spaces and line breaks do not count). A page with a clock, a visitor counter or rotating ads counts as changed every time; hide those with extraCss (for example .ad, #clock { display: none !important; }) or the hash will move on every run. The list is saved at the end of the run. If the store cannot be opened, the run stops before charging anything. Pages are still opened to compare, so a skipped page costs run time, not money. "Only changed" applies to links, not to raw HTML.
Options
| Input | Default | What it does |
|---|---|---|
urls | example.com, an RFC page | web pages to convert (http, https) |
html | none | raw HTML text, one PDF (up to 5 MB) |
datasetId, urlField | - , url | read links from another Actor's dataset; dotted paths and lists allowed |
format | A4 | A4, Letter, Legal, A3 |
landscape | off | sideways pages |
margins | 15/12/18/12 mm | top, right, bottom, left in mm, cm, in or px; one text like "12mm" sets all four |
printBackground | on | include background colours and images |
mediaType | print | print (the page's print style) or screen (the page as on screen) |
waitForSelector | none | wait until this CSS selector is on the page |
waitMs | 0 | extra wait after load, 0 to 30000 |
headerTemplate, footerTemplate | footer with page numbers | HTML for the top and bottom of every page |
extraCss | none | CSS added before printing, e.g. to hide cookie banners |
onlyChanged | off | skip pages whose text has not changed since the last run |
allowScripts | URLs: on, raw HTML: off | set it to override for every input |
lazyLoadScroll | on | scroll once so images that load on scroll are in the PDF |
maxItems | 200 | inputs per run (links, HTML and dataset together) |
maxPages | 200 | PDF pages per file; a longer page is cut off |
concurrency | 2 | pages at the same time, 1 to 5 |
timeoutSeconds | 60 | per page, 5 to 300 |
Notes:
- Header and footer. Chrome fills in the classes
date,title,url,pageNumberandtotalPages. Give the template afont-sizein its style (Chrome's default is tiny) and keep the top or bottom margin large enough for it. With only a footer, there is no header (and the other way round). - Hiding cookie banners. Use
extraCsswith the banner's selector:#onetrust-banner-sdk, .cookie-banner { display: none !important; }. It does not click "accept" for you. - Raw HTML. It is rendered with scripts off unless you set
allowScripts. Images and styles that the HTML links to are fetched like any page request (public addresses only);data:images inside raw HTML work. - Cut-off pages. If a row's
pagesequalsmaxPages, the page was probably longer and the PDF was cut.
Output
One dataset row per input. The PDF is stored in the run's key-value store, and pdfUrl is its public link.
{"url": "https://example.com","status": "ok","error": null,"pdfUrl": "https://api.apify.com/v2/key-value-stores/8ef17a6a-9f37-455a-bbd7-5ae313bdaeed/records/example-com-327c3fda.pdf","pdfKey": "example-com-327c3fda.pdf","pages": 1,"bytes": 67595,"title": "Example Domain","changed": null,"textHash": "43338e32beb5871d10be1ac1816172af"}
This row is from our local run of the prefilled input; the store id in the link is the one that run used on our machine. On Apify it is your run's store. For a failed input status is error, error says why and pdfUrl is null. For a skipped one status is skipped and changed is false. textHash is the hash of the page's visible text (the same text gives the same hash). For raw HTML, url is null. The files stay as long as your Apify storage retention keeps the run.
Limits
- Pages must be reachable without a login. Sites that show a bot check are not worked around; those pages come back as errors. Some sites block datacenter traffic and answer 403; the row shows the server's answer.
- Links to private, local-network and link-local addresses are rejected, and so is every request a page makes to such an address (images, frames, scripts, redirects).
file:andchrome:addresses are refused.data:is only allowed inside raw HTML, so inlinedata:images on a page opened from a link are not loaded. Limit: the host name is checked here and Chrome looks it up again itself, so an address that changes between the two is not caught. - At most 200 PDF pages per file, 5 MB of raw HTML, 20,000 characters per header or footer template.
- A very long or very heavy page can hit the timeout; raise
timeoutSeconds, or lowerconcurrency. - Fonts that the page does not provide are the ones installed on the Apify machine; the look can differ a little from your own browser.
- You are responsible for having the right to copy the pages you give it.
日本語
Web ページの URL(または他の Actor のデータセット、HTML テキスト)を、ヘッドレス Chrome で PDF に一括変換します。A4/Letter/Legal/A3、余白、横向き、背景の印刷、ページ番号入りのヘッダー・フッター、セレクタの出現待ち、cookie バナーを隠す CSS に対応。結果は実行のキー・バリューストアに PDF として保存され、公開リンクが入力1件につき1行のデータセットで返ります。スクレイパーの実行後に「取得した全ページを PDF で保存」する使い方と、スケジュール実行で「本文が変わったページだけ新しい日付入り PDF を作る」使い方(onlyChanged)ができます。料金は PDF 1件 $0.003。保存できた分だけ課金され、失敗・スキップは無料です。Bot チェック(Cloudflare・hCaptcha 等)が出るページはエラー行になり、回避はしません。プライベート/ローカルのアドレスへのアクセスは拒否されます。変換するページの権利はご自身でご確認ください。