Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use Chrome Headless’s --print-to-pdf flag to save a webpage as output.pdf in the current working directory. Add --no-pdf-header-footer to remove the printed date, URL, and page number. For timing, --timeout sets a maximum wait before capture; --virtual-time-budget advances time-dependent page scripts.

Print a webpage to PDF with Chrome Headless

Run this in a terminal, replacing the example URL with the page you want to capture:

chrome --headless --print-to-pdf https://example.com/

Chrome saves the file as output.pdf in the command’s current working directory. Run the command from the directory where you want that file to appear. The documented command does not specify a separate output-path option.

Remove the date, URL, and page number

Chrome’s PDF print output can include a header with the current date and time and a footer with the page URL and page number. Suppress both with --no-pdf-header-footer:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
chrome --headless --print-to-pdf --no-pdf-header-footer https://example.com/

The current documented spelling is --no-pdf-header-footer. Older Chrome versions may instead require --print-to-pdf-no-header. If Chrome rejects the current flag, check the installed browser version and try the legacy spelling:

chrome --headless --print-to-pdf --print-to-pdf-no-header https://example.com/

Choose when Chrome captures the page

Set a maximum wait with --timeout

--timeout=<milliseconds> sets the maximum wait before Chrome captures the page, even if it is still loading. For example, the Chrome documentation illustrates a five-second maximum:

chrome --headless --print-to-pdf --no-pdf-header-footer --timeout=5000 https://example.com/

This is an example, not a universal setting. A timeout does not guarantee that the page, network requests, or application rendering are complete when capture begins.

Advance time-dependent scripts with --virtual-time-budget

Use --virtual-time-budget=<milliseconds> when page behavior depends on timers or other time-based script execution. It advances virtual time while Chrome runs the page’s code. The documentation demonstrates --virtual-time-budget=42000 with a counter that updates over 42 seconds; that example does not make 42 seconds a suitable default for other pages.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
chrome --headless --print-to-pdf --no-pdf-header-footer --virtual-time-budget=42000 https://example.com/

Choose between the options based on the page: a timeout imposes a maximum wait before capture, while a virtual-time budget gives time-dependent scripts time to progress in the browser’s virtual clock. Neither setting, by itself, guarantees that every site-specific asynchronous task has finished.

Combined example

This invocation removes print headers and footers and caps the wait at five seconds:

chrome --headless --print-to-pdf --no-pdf-header-footer --timeout=5000 https://example.com/

Adjust the timeout to the page and the capture point you need. Use a virtual-time budget instead when the relevant content appears through time-dependent page code.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshooting

  • The header or footer still appears: Confirm the command includes --no-pdf-header-footer. If the installed Chrome version rejects that flag, try the older --print-to-pdf-no-header spelling.
  • You cannot find the PDF: Look for output.pdf in the terminal’s current working directory, not necessarily the directory containing Chrome.
  • The PDF is missing content that loads later: The timeout may have elapsed while the page was still loading. Increase the maximum wait as appropriate, or use a virtual-time budget if the content depends on timers. Neither option guarantees completion of all network or application work.

Or skip the browser setup

For an API-based PDF capture, ScreenshotNeo accepts a URL in one GET request. See the ScreenshotNeo documentation for its parameters.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o page.pdf

ScreenshotNeo can accept cookie and consent banners and remove known consent platforms, newsletter popups, and chat widgets before capture; each step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers indicate the page verdict and billing status. Its MCP server lets AI agents use screenshot and PDF capture tools. The free plan includes 1,000 shots a month with no card; paid plans start at $5 for 3,000 shots.

Sign up for ScreenshotNeo’s free plan.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.