How to Create a PDF from a Web Page Using Print CSS and Media Queries
Question details
Users need to generate a PDF from a webpage ensuring that the print stylesheet and media queries are correctly applied.

- 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.
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.
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.
Navigate to the target webpage using a modern browser like Google Chrome, Microsoft Edge, or Safari.
Press Ctrl + P (Windows) or Cmd + P (Mac) on your keyboard to open the browser's print dialog.
In the printer destination dropdown, select 'Save as PDF' or 'Microsoft Print to PDF'.
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 Dedicated Web-to-PDF Converters
If browser printing isn't sufficient or you need batch conversion, specialized online tools designed for print layouts can provide better results.
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. Download and install: Download WPS Office from the official website and install it on your device.
- 2. Open the converted PDF: Launch WPS Office, select the PDF module, and open the PDF file you generated from the webpage.
- 3. Edit and annotate: Use the editing, highlighting, and commenting tools located in the top ribbon to modify and finalize your PDF document.

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.




