The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →For a one-time export, open the page in a browser, use its print workflow, choose a PDF destination, check the preview, and save. For repeatable exports, use browser automation such as Puppeteer or Playwright, or a hosted HTML-to-PDF service. The main quality decision is whether the PDF should follow print styling or preserve the screen layout: both Puppeteer and Playwright use print CSS by default.
Choose the right way to export HTML to PDF
| Need | Good starting point | What to consider |
|---|---|---|
| Save one webpage occasionally | Your browser’s print workflow | Menu labels and PDF destinations vary by browser and operating system. Review the preview before saving. |
| Generate PDFs repeatedly in an application or script | Puppeteer or Playwright | You control navigation, rendering mode, page dimensions, margins, and other PDF options, and you manage the browser automation. |
| Use a managed conversion workflow | A hosted service such as CloudConvert | CloudConvert documents URL and HTML-file inputs, output settings, selector waits, and synchronous or asynchronous jobs. Evaluate the service’s workflow and terms for your needs. |
This guide covers webpage URLs as well as HTML you control. A URL capture renders the page in a browser; exporting a local HTML file instead requires loading that file in a browser or supplying the HTML to a service that accepts HTML input.
Save a webpage as PDF in a browser
- Open the webpage you want to save. If you are exporting a local HTML document, open that document in the browser instead.
- Open the browser’s print command. The exact menu path and wording depend on the browser and operating system; there is no single verified sequence that applies to every setup.
- Choose a PDF destination in the print dialog, then inspect the preview for missing content, awkward page breaks, or unwanted navigation.
- Adjust the available paper, layout, margin, or background options if needed, then save the PDF.
The preview is important: a page designed for a screen can paginate poorly, and print styling can hide or rearrange content. If you own the HTML and its design, add print-specific CSS rather than relying only on dialog settings.
Prepare HTML and CSS for printing
CSS can define one presentation for a screen and another for print. MDN documents @media rules for print-specific styling and the @page at-rule for printed-page styling. These let you make deliberate changes such as removing site navigation or adjusting page layout. Check the resulting PDF; do not assume every browser will render every style identically. See MDN’s printing CSS guidance.
Recommended Free Tools
#1 Best Overall
- Engineered for convenience – This new Brother Monochrome Laser Printer is conveniently equipped with a flatbed scan glass for quick copying and scanning. Mobile Device Compatibility AirPrint, Google Cloud Print 2.0, Brother iPrint and Scan, Mopria, Cortado Workplace
- Optimized for efficiency – Engineered with new features, the HL L2395DW laser printer (replacement for the HLL2380DW) and has been optimized for efficiency, allowing you to print up to 36 pages per minute(1)
- Faster, high quality prints: This monochrome laser printer is built with a 250 sheet paper capacity that helps improve efficiency due to less time spent refilling trays. It also handles both letter and legal sized paper. Power Source AC 120V 50/60Hz.Machine Noise (Ready/Printing): 30dB / 50dB
- Cloud based print & scan – Print from and scan to popular Cloud services directly from the 2.7" color touchscreen, including Dropbox, Google Drive, Evernote, OneNote, and more(4)
- Wireless printing & exceptional support – This printer’s simple to connect wireless technology allows you to submit print jobs from your laptop, smartphone, desktop, and tablets(2). The "Touch to connect" printing with NFC delivers added convenience(3).
@media print {
/* Example: omit navigation when it is not useful on paper. */
nav {
display: none;
}
}
@page {
/* Choose page rules appropriate to your document. */
margin: 18mm;
}
The CSS above is an example to adapt, not a universal prescription: hiding navigation may be right for an article but wrong for a document where the navigation contains essential context. You can also use print styles to control page breaks and simplify screen-oriented layouts.
Generate a PDF with Puppeteer
Puppeteer’s Page.pdf() generates a PDF using print CSS by default. If you want the page’s screen styling instead, call page.emulateMediaType('screen') before generating the PDF. The official API documents options for paper format, margins, page ranges, backgrounds, and CSS page size. Its documented waitForFonts option defaults to true. See the Puppeteer Page.pdf() API (the documentation displayed version 25.12.0 when consulted).
Runnable Node.js example
Install Puppeteer in a Node.js project, then save this as export-pdf.js. Replace the URL and output path for your job.
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch();
try {
const page = await browser.newPage();
await page.goto('https://example.com', { waitUntil: 'networkidle0' });
await page.pdf({
path: 'page.pdf',
format: 'A4',
printBackground: true,
margin: {
top: '18mm',
right: '18mm',
bottom: '18mm',
left: '18mm'
}
});
} finally {
await browser.close();
}
})();
This example uses print styling, includes background graphics, and sets margins. To use screen styling, add await page.emulateMediaType('screen'); after navigation and before page.pdf(). For a page whose content is loaded asynchronously, choose a readiness condition that matches the page; waiting for network activity to settle is not proof that every application has finished rendering.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Useful Puppeteer PDF controls
formatselects a paper format. The API also supports dimensions and margin settings.pageRangeslimits which pages are output, where a page-range export is appropriate.printBackgroundcontrols whether background graphics are printed; Puppeteer documents its default as false.preferCSSPageSizelets CSS page sizing take precedence when that matches the document’s design.waitForFontscontrols font readiness; the documentation says it defaults to true.
Consult the current API documentation for accepted values and interactions among options rather than assuming a browser print dialog and automation expose identical controls.
Rank #2
- FAST PRINT AND SCAN: The Brother MFC-L3710CW lets you get things done with up to 19 ppm print speed and scans up to 29 ipm in black and 22 ipm in color
- AFFORDABLE AND FLEXIBLE COLOR PRINTING: Affordably print professional quality, rich, vivid color documents with laser printer quality. The 250 sheet adjustable paper tray helps minimize refills and the manual feed slot handles varied printing needs
- 3.7” COLOR TOUCHSCREEN: Print from and scan to popular cloud apps directly from the 3.7" color touchscreen including Dropbox, Google Drive, Evernote, OneNote and more. Save time by creating custom shortcuts on the touchscreen for your most used features.
- PRINT AND CONNECT YOUR WAY: Print wirelessly from your desktop, laptop, smartphone and tablet with built-in wireless, and Wi-Fi Direct or connect locally to a single computer via USB interface.
- UNIT DIMENSIONS (WxDxH): 16.1” W x 18.7” D x 16.3” H
Generate a PDF with Playwright
Playwright’s page.pdf() also uses print CSS by default. To render with screen media instead, call page.emulateMedia({ media: 'screen' }) before PDF generation. Its documented options include paper format, margins, page ranges, background printing, and CSS page-size preference. Playwright also notes that print color may be modified by default. See the Playwright Page API.
Runnable Node.js example
Install Playwright and the browser runtime required by your setup, then save this as export-playwright.js.
const { chromium } = require('playwright');
(async () => {
const browser = await chromium.launch();
try {
const page = await browser.newPage();
await page.goto('https://example.com', { waitUntil: 'networkidle' });
await page.pdf({
path: 'page.pdf',
format: 'A4',
printBackground: true,
margin: {
top: '18mm',
right: '18mm',
bottom: '18mm',
left: '18mm'
}
});
} finally {
await browser.close();
}
})();
To use screen media, insert await page.emulateMedia({ media: 'screen' }); after navigation and before page.pdf(). As with Puppeteer, set the page size and backgrounds intentionally, then inspect the generated file. For exact option names and defaults, refer to the current Playwright API.
Use a hosted HTML-to-PDF service
A hosted converter can be useful when you want a managed conversion endpoint rather than operating browser automation yourself. CloudConvert documents an HTML-to-PDF API that accepts URLs or HTML files, supports page-output settings such as size and margins, can wait for a custom CSS selector, and can process jobs synchronously or asynchronously. Its separate Capture Website operation reference describes capturing a website to PDF and its parameters. These are vendor-documented capabilities, not independent guarantees that every website will render as expected. Review the current API documentation for implementation details.
Selector waits can help when the page has an identifiable element that appears after its content is ready. They do not ensure that every image, font, animation, or other asynchronous component has finished loading. Pick a readiness signal that represents the content you need and check representative outputs.
Rank #3
- Create a mix using audio, music and voice tracks and recordings.
- Customize your tracks with amazing effects and helpful editing tools.
- Use tools like the Beat Maker and Midi Creator.
- Work efficiently by using Bookmarks and tools like Effect Chain, which allow you to apply multiple effects at a time
- Use one of the many other NCH multimedia applications that are integrated with MixPad.
Or skip the browser setup
For a website capture, ScreenshotNeo is a screenshot API and MCP server for developers. Its endpoint can return a screenshot or PDF; use its documentation for the output settings needed for PDF. This one-call example captures the target page as WebP:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo API documentation for PDF output and other parameters. ScreenshotNeo accepts cookie and consent banners as a visitor and removes 60+ known consent platforms, newsletter popups, and chat widgets before capture; each of those steps can be turned off. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and responses identify the page verdict and billing status in headers. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients. The free plan includes 1,000 shots per month without a card; paid plans start at $5 for 3,000 shots. See ScreenshotNeo for the service and plan details.
Sign up for ScreenshotNeo’s free plan: 1,000 screenshots a month, no card required.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Common problems and fixes
The PDF looks different from the browser window
That is often expected when print CSS is active: both Puppeteer and Playwright use print media by default. If screen styling is the intended result, switch the emulated media type before creating the PDF. If print styling is intended, review your @media print rules and inspect the preview or output.
Background colors or images are missing
Check the PDF option for background printing. Puppeteer documents printBackground as false by default; Playwright provides a background-printing option as well. Also inspect whether the page’s own CSS uses backgrounds that make sense on paper.
Content or fonts appear incomplete
Some pages populate content after initial navigation. Wait for an application-specific selector or other meaningful readiness condition before exporting. Puppeteer documents font waiting and defaults waitForFonts to true; that does not guarantee that an external font or other resource will always load successfully. CloudConvert documents waiting for a custom CSS selector for hosted captures.
Rank #4
- 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
Pages break at awkward points or use the wrong size
Review the page format, margins, page ranges, and CSS page rules. If your CSS defines a page size, check whether the API’s CSS-page-size preference should be enabled. The settings that produce a readable print document may differ from the settings that preserve a screen layout.
A URL capture fails or returns an unexpected page
Confirm the URL is reachable by the browser or service making the request and that the page’s required content has finished loading before capture. Authentication, bot checks, and client-side rendering can affect a remote capture. Use the provider’s documented status and error information to diagnose the specific failure; a longer wait alone cannot fix every access or rendering issue.
Quality, reliability, and cost considerations
For occasional use, browser printing avoids building a conversion pipeline. For repeatable jobs, browser automation adds control but also means your application must launch and manage a browser, choose appropriate readiness conditions, and handle failures. A hosted API shifts more of that operational workflow to a service, but introduces a provider dependency and its own pricing and terms. The cited documentation does not establish a universal speed, fidelity, or cost winner, so compare using representative pages and your expected workload.
Regardless of method, test more than one page type: a short article, a long page, pages with images or web fonts, and pages with dynamic content. Compare the result against the intended output, including page breaks, color, paper size, and whether important content was omitted. A successful conversion request is not by itself evidence of a correct PDF.
Frequently Asked Questions
Can I export a local HTML file rather than a webpage URL?
Yes. Open the file in a browser and use its print workflow, or use a conversion workflow that accepts HTML files. CloudConvert documents HTML-file input; check its current API reference for the required request format.
Does converting HTML to PDF preserve clickable links?
The cited documentation does not establish link behavior for every browser or service. Check the output PDF in your intended reader and verify links if they matter to your use case.
Quick Recap
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.

