October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
Chrome

How to Convert a Web Page to PDF on Linux

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

The quickest method is your browser’s print dialog: open the page, press Ctrl+P, choose Save to PDF, inspect the preview, and save the file. For repeatable jobs, use headless Chrome/Chromium or wkhtmltopdf from the command line. The right choice depends on whether you need occasional manual output, browser-level fidelity, or scriptable batch conversion.

Choose the method that fits the job

Method Best for Main limitation
Firefox or another browser’s print dialog One-off saves and visual inspection Manual interaction; labels vary by browser and Linux desktop
Headless Chrome or Chromium Automation using a current browser rendering engine Dynamic pages may need an appropriate wait; command names differ by installation
wkhtmltopdf Scripts that need explicit JavaScript, print-media, or page-layout switches Uses Qt WebKit, so output may differ from a modern browser

Save a page as PDF with Firefox

  1. Open the page in Firefox on your Linux desktop.
  2. Open the print dialog with Ctrl+P, or use Firefox’s menu and choose Print.
  3. In the print preview, open the destination selector and choose Save to PDF.
  4. Review the preview. Check that headings, images, tables, page breaks, orientation, margins, and the page range are correct. The preview represents the page’s print rendering, not necessarily its interactive screen appearance.
  5. Choose a filename and location, then save.

Firefox’s documented workflow is based on the destination dropdown. Exact controls can vary with Firefox versions, desktop integration, and other Linux browsers. If a page looks wrong, change print orientation, margins, scale, or page range before saving rather than editing the PDF afterward.

Why the preview matters

  • Sites can provide print-specific CSS that hides navigation, ads, or interactive controls.
  • Content loaded only after scripts run may not appear if it has not finished loading.
  • Very wide tables may be split or clipped; landscape orientation and smaller margins can help.
  • Some pages intentionally omit backgrounds or colors in print mode. Enable background graphics only if your browser offers that option and you need them.

Create a PDF from the Linux command line with Chrome or Chromium

Chrome’s documented headless flow is:

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

The default output is output.pdf in the current working directory. The executable may be named google-chrome, google-chrome-stable, chromium, or chromium-browser on your distribution. Replace chrome with the command installed on your system.

Choose an output filename

Use an absolute or relative output path supported by your installed browser build:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Nero CD Ripper Software | Convert Audio CDs to MP3, FLAC, AAC, WAV | Digitize Music with Gracenote Recognition | Burning ROM Technology | Lifetime License | 1 PC | Windows 11/10
  • ✔️ Easily digitize your audio CDs and convert them into digital music files for playback on your PC, smartphone, tablet, USB drive, media player, and other compatible devices.
  • ✔️ Integrated Gracenote music recognition automatically identifies and adds track titles, artists, album information, genres, and cover artwork to your digital music library.
  • ✔️ Convert audio CDs into more than 100 audio formats, including MP3, FLAC, AAC, WAV, AIFF, and OGG, ideal for mobile listening, music archiving, or maximum compatibility.
  • ✔️ Create playlists automatically for your ripped tracks, helping you keep your music collection organized, structured, and easy to browse after digitizing your CDs.
  • ✔️ Powered by proven Nero Burning ROM technology for reliable, accurate, and high-quality CD ripping, with a lifetime license for 1 Windows PC and no subscription.
chrome --headless --print-to-pdf=/home/alex/Documents/page.pdf https://example.com/

Quote URLs and paths containing shell metacharacters or spaces. If your build does not accept the equals form, consult its local command-line help and use the syntax it reports.

Remove generated headers and footers

Chrome documents this option:

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

It suppresses generated date, URL, and page-number headers and footers. Older Chrome versions used --print-to-pdf-no-header; if the current spelling is rejected, check the documentation for the version installed on your Linux system.

Allow more time for loading

Chrome documents --timeout in milliseconds:

chrome --headless --timeout=15000 --print-to-pdf=/tmp/page.pdf https://example.com/

This sets a maximum wait before capture, including when the page is still loading. It is not a guarantee that every lazy image, advertisement, chart, or application request has completed. For repeatable results, first identify what the page needs to render, then choose a timeout with margin and verify representative output.

Make the command scriptable

A simple shell loop can convert several URLs:

while read -r url; do
  name=$(printf '%s' "$url" | sed 's#https?://##; s#[^A-Za-z0-9._-]#_#g')
  chrome --headless --print-to-pdf="pdf/$name.pdf" "$url"
done < urls.txt

Create the pdf directory first and review generated names for collisions. Do not pass untrusted URLs to a script without considering access to local or private network resources.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Learn How to Use Linux, Ubuntu Linux 22.04 Bootable 8GB USB Flash Drive - Includes Boot Repair and Install Guide Now with USB Type C
  • Ubuntu Linux 22 on a Bootable 8 GB USB type C OTG phone compatible storage
  • The preinstalled USB stick allows you to learn how to learn to use Linux, boot and load Linux without uninstalling your current OS
  • Comes with an easy-to-follow install guide. 24/7 software support via email included.
  • Comprehensive installation includes lifetime free updates and multi-language support, productivity suite, Web browser, instant messaging, image editing, multimedia, and email for your everyday needs
  • Boot repair is a very useful tool! This USB drive will work on all modern-day computers, laptops or desktops, custom builds or manufacture built!

Use wkhtmltopdf for command-line conversion

wkhtmltopdf accepts a URL or local file followed by an output path:

wkhtmltopdf https://example.com/ output.pdf

The project describes it as a headless HTML-to-PDF converter built on Qt WebKit. Its usage manual exposes switches for JavaScript, print-media selection, page dimensions, margins, and local-file access. These options are useful when diagnosing a specific page, but they do not make rendering identical to a current Chrome release.

Useful diagnostic options

  • JavaScript: use the build’s JavaScript enable/disable and delay controls to determine whether scripts are responsible for missing content.
  • Print media: select print media when the site has separate screen and print styles.
  • Page geometry: set paper size, orientation, margins, and dimensions to control pagination.
  • Local files: review local-file-access restrictions before converting an HTML file that references local images, fonts, or stylesheets. Relaxing restrictions can expose local data, so do it only for files you trust.

Distribution packages can differ in patches and defaults. Check the installed binary’s manual and package documentation rather than assuming every option behaves the same way.

Convert a local HTML file

For a local document, pass a file URL or filename in the form accepted by your converter:

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.
Rank #3
Corel PDF Fusion Software
  • Save money by using PDF Fusion to view over 100 file formats without having to purchase additional software
  • Merge incompatible files quickly and easily by dragging and dropping in PDF Fusion to create a new PDF documents
  • Save time with PDF Fusion's editing tools to reuse the content from existing documents without starting from scratch
wkhtmltopdf file:///home/alex/page.html /home/alex/page.pdf

With Chrome, use a file URL only when your browser build and security policy permit local-file loading. A page that depends on remote JavaScript, fonts, or images may render differently offline. Put required assets in reachable locations and test the resulting PDF.

When CUPS is involved

CUPS handles printing an existing document; it is not required to create a PDF from a web page. After conversion, you can send the file to a configured printer with tools such as:

lp page.pdf

CUPS accepts several document types and provides command-line print options. Keep the stages separate: Firefox, Chrome, or wkhtmltopdf creates the PDF; CUPS sends that PDF to a printer.

Fix common conversion problems

Blank or partially blank PDF

  • Confirm the URL loads normally in a browser.
  • Increase Chrome’s timeout or wkhtmltopdf’s JavaScript delay.
  • Check whether the page requires authentication, a consent action, or an interactive step.
  • Compare browser print preview with command-line output to determine whether the issue is page rendering or the converter.

Images or charts are missing

  • Wait for lazy-loaded content before printing.
  • Check network access, blocked resources, and local-file permissions.
  • For a page you control, ensure images have stable dimensions and that scripts finish drawing charts before capture.

Headers, footers, or URLs appear unexpectedly

Use Chrome’s --no-pdf-header-footer. If it fails, try the older --print-to-pdf-no-header spelling documented for earlier versions. In a GUI print dialog, disable browser headers and footers if that control is offered.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
DeskFX Free Audio Effects & Audio Enhancer Software [PC Download]
  • Transform audio playing via your speakers and headphones
  • Improve sound quality by adjusting it with effects
  • Take control over the sound playing through audio hardware

Layout is clipped or pagination is poor

  • Use the browser preview to test landscape orientation, margins, scale, and page range.
  • With wkhtmltopdf, adjust paper size and margin options and select print media when appropriate.
  • Remember that responsive layouts can change at the converter’s viewport width.

Fonts or colors differ

The converter may use a different rendering engine, installed font set, or print stylesheet. Compare Chrome and wkhtmltopdf output, install required fonts on the Linux system, and inspect the page’s print CSS.

Command not found

Locate the installed browser or converter with your distribution’s package tools, then run its executable name directly. Because package names and installation commands vary by distribution, follow the instructions for your specific Linux release.

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

Or skip the browser setup: ScreenshotNeo

ScreenshotNeo converts a URL to an image or PDF through one HTTP request, which is useful for deployment scripts, CI jobs, and services that should not manage a local browser. It accepts consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each cleanup step can be turned off. Bot checks, CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients.

See the ScreenshotNeo documentation for parameters and authentication. A PDF request uses the same endpoint:

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 -d format=pdf -o page.pdf

It also supports full-page capture, lazy-image loading, CSS-selector element capture, dark mode, device presets and custom viewports, retina scale, paper size, margins, landscape mode, page ranges, custom CSS and JavaScript, clicks, selector waits, delays, network-idle waits, request blocking, headers, cookies, user agents, Authorization, timezone, geolocation, transparent backgrounds, resizing, chosen cache TTLs, signed image links, asynchronous jobs with signed webhooks, bulk capture of up to 100 URLs per call, usage reporting, and an OpenAPI specification. Parameter names used by other screenshot APIs are accepted to ease migration.

Best Value
Learn How to Use Linux, Linux Mint Cinnamon 22 Bootable 8GB USB Flash Drive - Includes Boot Repair and Install Guide Now with USB Type C
  • Linux Mint 22 on a Bootable 8 GB USB type C OTG phone compatible storage
  • The preinstalled USB stick allows you to learn how to learn to use Linux, boot and load Linux without uninstalling your current OS
  • Comes with an easy-to-follow install guide. 24/7 software support via email included.
  • Comprehensive installation includes lifetime free updates and multi-language support, productivity suite, Web browser, instant messaging, image editing, multimedia, and email for your everyday needs
  • Boot repair is a very useful tool! This USB drive will work on all modern-day computers, laptops or desktops, custom builds or manufacture built!

Free usage includes 1,000 shots per month with no card. Paid plans start at $5 for 3,000 shots; every feature is included on every plan. Create a free ScreenshotNeo account.

Performance, reliability, and cost decisions

  • Occasional conversion: the browser dialog has the lowest setup cost and lets you inspect every page.
  • Local automation: headless Chrome follows a current browser rendering path and is a practical default for scripts.
  • Legacy or tightly controlled workflows: wkhtmltopdf offers explicit switches, but validate output for modern JavaScript-heavy pages.
  • Hosted automation: ScreenshotNeo avoids maintaining browser binaries and bills only clean shots; failed loads and cache hits are not billed.
  • Quality control: keep sample URLs covering long pages, tables, lazy images, authentication, and print-specific CSS. Compare PDFs after browser or package upgrades.

FAQ

Does Linux need a physical printer to create a PDF?

No. The browser or conversion utility writes the PDF directly. CUPS is only needed when you want to print that finished file.

Which method best matches Chrome’s on-screen rendering?

Headless Chrome or Chromium uses the Chrome rendering path. wkhtmltopdf uses Qt WebKit and can therefore produce different layout and script behavior.

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

Can I convert a page that requires a login?

Only if the conversion environment can authenticate. A normal browser session may have cookies and credentials that a fresh headless process does not; configure authentication explicitly and handle credentials securely.

Why does a PDF have fewer pages than the web page?

PDF pagination follows print layout, not screen scrolling. Print CSS, hidden interactive sections, scaling, and page margins can all change the page count.

Frequently Asked Questions

Can I preserve clickable links in the PDF?

Browser print and converter support for PDF link annotations varies by browser, version, and page. Open the saved PDF in your viewer and test the links rather than assuming every URL remains clickable.

How should I archive a page that changes frequently?

Record the source URL, capture date, converter and relevant options, then retain the generated PDF. For repeat captures, use a script or hosted API and compare outputs over time.

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

Quick Recap

Bestseller No. 2
Learn How to Use Linux, Ubuntu Linux 22.04 Bootable 8GB USB Flash Drive - Includes Boot Repair and Install Guide Now with USB Type C
Learn How to Use Linux, Ubuntu Linux 22.04 Bootable 8GB USB Flash Drive - Includes Boot Repair and Install Guide Now with USB Type C
Ubuntu Linux 22 on a Bootable 8 GB USB type C OTG phone compatible storage; Comes with an easy-to-follow install guide. 24/7 software support via email included.
$22.95
Bestseller No. 3
Bestseller No. 4
DeskFX Free Audio Effects & Audio Enhancer Software [PC Download]
DeskFX Free Audio Effects & Audio Enhancer Software [PC Download]
Transform audio playing via your speakers and headphones; Improve sound quality by adjusting it with effects
Bestseller No. 5
Learn How to Use Linux, Linux Mint Cinnamon 22 Bootable 8GB USB Flash Drive - Includes Boot Repair and Install Guide Now with USB Type C
Learn How to Use Linux, Linux Mint Cinnamon 22 Bootable 8GB USB Flash Drive - Includes Boot Repair and Install Guide Now with USB Type C
Linux Mint 22 on a Bootable 8 GB USB type C OTG phone compatible storage; Comes with an easy-to-follow install guide. 24/7 software support via email included.
$22.95

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

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

Read next

Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.