Home / Guides / How to Convert a URL to PDF

Updated

How to Convert a URL to PDF (One Page or Thousands)

To convert a URL to PDF, open it in a browser and print to PDF, or, for many pages, let a headless browser such as Chromium (through Playwright or Puppeteer) load each URL and print it with fixed settings. Scroll the page first so lazy images load, hide cookie banners with CSS, choose the paper size and backgrounds, and keep the source URL and date with each file. For thousands of URLs, a bulk tool adds parallel pages, retries and clear errors for pages that block automated browsers.

1. One page: the browser

Print (Ctrl+P or Cmd+P), destination Save as PDF, enable Background graphics if colours matter. Quick, but manual and not repeatable.

2. Scripted: headless Chromium

npm i playwright
node -e "const {chromium}=require('playwright');(async()=>{const b=await chromium.launch();const p=await b.newPage();await p.goto('https://example.com',{waitUntil:'networkidle'});await p.pdf({path:'page.pdf',format:'A4',printBackground:true});await b.close()})()"

PDF printing works in headless Chromium only. Pages that load images on scroll need a scroll before pdf(); banners can be hidden with page.addStyleTag.

3. Common problems

4. Many URLs

For archiving, compliance records or reports over hundreds of pages, Plainprobe Website Screenshot returns a PDF (or PNG, JPEG, WebP) per URL with a direct link, hides common cookie banners with CSS, runs pages in parallel with retries, and reports blocked or failed pages as typed errors that are not charged ($0.003 per full-page capture or PDF). To turn PDFs back into text for an AI model, see PDF to Markdown for LLMs.

Limits to keep in mind

FAQ

How do I save a web page as a PDF?

For one page, use the browser's Print dialog and choose Save as PDF. For many pages or a scheduled job, a headless browser (Chromium through Playwright or Puppeteer) renders each URL and prints it to PDF with the same settings every time.

Why does my PDF have a cookie banner or missing images?

The page was printed before lazy-loaded images appeared, or with the consent banner on top. Scroll the page before printing and hide the banner with CSS; do not click Accept on the visitor's behalf.

PDF or full-page screenshot?

A PDF keeps selectable text and splits the page into printable sheets; a full-page PNG keeps the exact on-screen look in one image. Archive with PDF, compare visual changes with images.

Can I convert pages behind a login?

Not with a public converter. Convert only public pages, or pages you are allowed to automate.

Related tool