PDF Conversion Issues

How to Create a PDF from a Web Page Using Print CSS and Media Queries

Steve KSteve K Nov 3, 2026 869 views

Question details

Users need to generate a PDF from a webpage ensuring that the print stylesheet and media queries are correctly applied.

How to Create a PDF from a Web Page Using Print CSS and Media Queries
Product
Web Browsers and PDF Converters
Device & OS
not provided
Scenario
Converting an HTML webpage to a PDF document while preserving print-specific formatting and layouts.
Observed behavior
Adobe Acrobat's built-in HTML-to-PDF conversion often applies screen styling instead of the intended print layout, ignoring print media queries.
Before you start

Ensure your webpage has a properly configured print stylesheet (@media print) and preview the page layout in a web browser before attempting the PDF conversion.

Solution 1Recommended

Use Web Browser Print to PDF Feature

Modern web browsers generally have robust support for print CSS and can natively save webpages as properly formatted PDFs.

Instead of relying on third-party PDF extensions that parse HTML independently, you can use the browser's native print engine. Browsers are natively designed to interpret CSS media queries, including @media print rules.

1
Open the webpage

Navigate to the target webpage using a modern browser like Google Chrome, Microsoft Edge, or Safari.

2
Open the Print Dialog

Press Ctrl + P (Windows) or Cmd + P (Mac) on your keyboard to open the browser's print dialog.

3
Change the destination

In the printer destination dropdown, select 'Save as PDF' or 'Microsoft Print to PDF'.

4
Verify and Save

Check the print preview to ensure the print stylesheet is applied correctly, then click 'Save' and choose a location to download your formatted PDF.

Use Web Browser Print to PDF Feature
Print Preview Validation: Always validate the output layout in the print preview window; what you see there is exactly how the generated PDF will look.
Free Microsoft Office alternative

Edit and Manage Your Converted PDFs with WPS Office

After converting your webpage to a PDF using your browser, you may need to annotate, merge, or edit the document. WPS Office offers a lightweight, free alternative to expensive PDF editors, ensuring your workflow remains seamless and format-compatible.

  1. 1. Download and install: Download WPS Office from the official website and install it on your device.
  2. 2. Open the converted PDF: Launch WPS Office, select the PDF module, and open the PDF file you generated from the webpage.
  3. 3. Edit and annotate: Use the editing, highlighting, and commenting tools located in the top ribbon to modify and finalize your PDF document.
Fully compatible with standard PDF formats and Adobe Acrobat files.Lightweight and completely free for basic PDF viewing and annotation.Includes a powerful suite of Word, Excel, PowerPoint, and PDF tools in one application.Familiar, easy-to-use interface that requires no learning curve.
microsoft office alternative - wps office

Frequently Asked Questions

Why does Adobe Acrobat ignore my print media queries when converting HTML to PDF?

Adobe Acrobat uses its own internal rendering engine for HTML-to-PDF conversions, which often defaults to screen styling and frequently fails to properly recognize standard @media print CSS rules found on modern webpages.

How do I test my print CSS layout before converting to a PDF?

You can test print styles in Chrome by pressing F12 to open Developer Tools, clicking the three-dot menu, selecting 'More tools' > 'Rendering', and changing the 'Emulate CSS media' dropdown to 'print'.

Are there any desktop applications for Mac that honor print CSS better than standard tools?

Yes, many Mac users recommend free utilities like Paparazzi! which are specifically designed to capture webpages as PDFs or images while accurately honoring CSS formatting and media queries.