For a one-time PDF, let the page finish rendering, open your browser’s print dialog, and save to PDF. For repeatable output, use a browser automation tool such as Puppeteer and call page.pdf(). If you control the page, add print-specific CSS; if it contains a responsive canvas chart, resize the chart for print and inspect the resulting PDF.
The key is that a page can look complete on screen before its chart, fonts, or data are ready for printing. Print preview and the saved PDF—not the screen alone—show whether the layout, chart dimensions, colors, and page breaks worked.
Choose a method: print dialog or automated PDF
Use the browser’s print interface when you need to save a page once and can check the result manually. Use Puppeteer when you need a repeatable PDF workflow, such as generating reports from a page on a schedule. If you own the page, print CSS lets you remove screen-only controls and adjust the document layout. For a third-party page, you may have only the website’s print styling and the browser’s print settings.
- One-off: Wait for the page and its late-loading content, open print, review the preview, and save to PDF.
- Page you control: Add
@media printstyles and, where appropriate,@pagerules. - Repeated or automated: Use Puppeteer’s
Page.pdf(), with a readiness condition and PDF options suited to the page. - Canvas chart: Check whether its chart library needs to resize when print layout is applied. Chart.js documents print-specific resize hooks; other libraries may require their own approach.
A PDF is a document output, not an interactive copy of the webpage. Don’t assume arbitrary sites, browsers, or chart libraries will produce identical output without checking it.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
#1 Best Overall
- BEST FOR SMALL BUSINESSES – Engineered for extraordinary productivity, the Brother DCP-L2640DW Monochrome (Black & White) 3-in-1 combines laser printer, scanner, copier in one compact footprint and delivers high-quality black & white prints
- FAST PRINTER WITH EFFICIENT SCANNING – Produces documents quickly with print speeds up to 36 ppm(2) and scan speeds up to 23.6/7.9 ipm(3) (black/color). A 50-page auto document feeder(4) allows for convenient, time saving multi-page scanning and copying
- FLEXIBLE CONNECTION OPTIONS – Easily navigate the changing demands of your business with secure multi-device connectivity via built-in dual-band wireless (2.4GHz / 5GHz) and Ethernet. Or connect locally to a single computer via USB interface
- BROTHER MOBILE CONNECT APP – Print, scan, and manage your wireless printer anytime, from almost anywhere from your mobile device. Order Brother Genuine Supplies, track toner usage, and complete more work on-the-go(5)
- CHOOSE BROTHER GENUINE TONER – When it’s time to replace your toner, be sure to choose Brother Genuine TN830 or TN830XL replacement toner. And with Refresh EZ Print Subscription Service, you’ll never worry about running out of toner again and you’ll enjoy savings of up to 50%(6) on Brother Genuine Toner. Get started with Refresh today with a Free Trial(1)
Save a JavaScript page to PDF once
- Open the page and wait for all content you need. A chart may appear after its data request; fonts, images, or other assets can also arrive after the initial page view.
- Open your browser’s print interface. Common shortcuts are Ctrl+P on Windows or Linux and Command+P on macOS; menu names and PDF destinations vary by browser and operating system.
- Choose a PDF or save-to-PDF destination if offered, then examine the print preview.
- Set paper size, orientation, scale, and margins to fit the content. For a wide chart, try landscape orientation or a larger page, then make sure the labels and other text are still legible.
- Save the PDF and inspect the actual file, especially if the chart was missing, clipped, blank, or difficult to read in preview.
If the chart looks wrong, first give its data and rendering time to finish. Then check the preview at the intended page size. If the page offers its own export feature, try that too. Canvas-based charts may need an explicit resize when the print layout changes their available space.
Add print styling to a page you control
Use print CSS to change the page’s structure for paper or PDF: hide navigation and interactive controls, relax screen-width constraints, keep essential content, and manage page breaks. MDN explains how @media print and print stylesheets apply styles for printed media. A separate @page rule can specify page dimensions, orientation, and margins. Exact behavior can vary between browsers and versions, so verify the output in the browser you use to generate it.
@media print {
nav,
.screen-only,
button {
display: none !important;
}
main {
width: 100%;
max-width: none;
}
h1, h2, h3 {
break-after: avoid;
}
.chart-container {
break-inside: avoid;
}
}
@page {
size: A4 portrait;
margin: 12mm;
}
Use selectors that match your own page; the example is not a universal stylesheet. For example, hiding every button is unsuitable if a button’s label or state conveys information that belongs in the printed document. Page-break rules are requests to the layout engine, not a guarantee that every browser will paginate every element identically.
Rank #2
- BEST FOR HOMES & HOME OFFICES – Engineered for consistent, premium print quality, the Brother HL-L2405W Monochrome (Black & White) Laser Printer delivers sharp, crisp prints at an affordable price. Prints one-sided documents at speeds up to 30ppm(2)
- COMPACT, CONNECTED PRINTER – Flexible connection options make this an ideal printer for home use and at-home offices. Securely connect to multiple devices with built-in dual-band wireless (2.4GHz/5GHz) or locally to a single computer via USB interface
- BROTHER MOBILE CONNECT APP – Manage your printer remotely and print from your mobile device anytime, from almost anywhere. Order Brother Genuine Supplies, track toner usage, and complete more work on-the-go(3)
- VERSATILE PAPER HANDLING – Enjoy seamless, reliable everyday printing with the 250-sheet paper tray(4) and a manual feed slot that enables printing on envelopes and specialty pape
- BROTHER IS AT YOUR SIDE – Backed by Brother with a 1-year limited warranty and free online, call, or live chat support for the life of your printer
Check color and background output
Screen colors do not necessarily carry over unchanged. Puppeteer’s PDF documentation says its generated output uses print CSS media and that colors are modified for printing by default. It documents -webkit-print-color-adjust as a way to request exact colors; whether that styling is honored depends on the rendering context. For Puppeteer, background graphics are also controlled by a separate PDF option. See the Puppeteer Page.pdf() documentation and its PDF options reference.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →@media print {
.brand-panel {
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
}
}
Requesting exact color can preserve a design’s intended color treatment, but it does not remove the need to check contrast and readability in the final PDF.
Make responsive canvas charts print correctly
A chart may render correctly on screen yet have the wrong dimensions after the page switches to print layout. Chart.js explains that a canvas’s rendered size and its CSS display size are independent; sizing it through CSS alone can therefore produce inaccurate output. Its responsive-chart guidance recommends handling print with a beforeprint resize and restoring automatic sizing with afterprint. It also cautions that browser print-layout and resize-event timing can complicate the result.
Rank #3
- FAST PRINT SPEEDS: Print up to 19 pages per minute.
- COMPACT DESIGN: Space-saving, compact design fits anywhere in your home, school or small office.
- WIRELESS CONNECTIVITY: Print from almost anywhere in your workspace using your compatible mobile device.
- PAPER CAPACITY: Up to 150 sheets.
- SUSTAINABILITY: Uses less than 2 watts in Energy Saver mode.
For a Chart.js chart instance called chart, the documented pattern is to resize for print and then restore automatic sizing afterward:
window.addEventListener('beforeprint', () => {
chart.resize(1200, 800);
});
window.addEventListener('afterprint', () => {
chart.resize();
});
Choose dimensions appropriate to your chart and intended output; the values above are an example, not a universal setting. Apply the print CSS, wait until chart data and rendering are complete, and inspect the print preview and saved PDF at the desired paper size. This hook is Chart.js-specific guidance, not a universal API for all chart libraries.
Generate PDFs repeatedly with Puppeteer
Puppeteer’s Page.pdf() generates a PDF using the print CSS media type by default. To render screen styles instead, its documentation says to call page.emulateMediaType('screen') before creating the PDF. Its PDF-generation guide says Page.pdf() waits for fonts by default. The current API references in the documentation are for Puppeteer 25.12.0; options and browser behavior can change across releases.
Rank #4
- BEST FOR HOME OFFICES & SMALL TEAMS – Engineered for consistent, premium print quality, the Brother HL-L2460DW Monochrome (Black & White) Laser Printer produces documents that are clear, crisp, and easy to review and share, all at an affordable price
- COMPACT, CONNECTED, EXCEPTIONALLY EFFICIENT– Connect with built-in dual-band wireless (2.4GHz/5GHz), Ethernet, or to a single computer via USB interface. Prints at speeds up to 36ppm(2), plus automatic duplex printing saves time and reduces paper waste
- BROTHER MOBILE CONNECT APP – Manage your wireless printer remotely and print from your mobile device anytime, from almost anywhere. Order Brother Genuine Supplies, track toner usage, and complete more work on-the-go(3)
- VERSATILE PAPER HANDLING – Tackle high-volume black & white printing with the 250-sheet capacity paper tray.(4) The manual feed slot enables printing on envelopes and specialty paper
- BROTHER IS AT YOUR SIDE – Backed by Brother with a 1-year limited warranty and free online, call, or live chat support for the life of your printer
Install and run a basic PDF script
In a new Node.js project, install Puppeteer with npm install puppeteer. Save the following as pdf.mjs, replace the example URL with the page you need, and run node pdf.mjs. Puppeteer’s installation setup supplies a browser for the package to launch.
import puppeteer from 'puppeteer';
const url = 'https://example.com/report';
const browser = await puppeteer.launch();
try {
const page = await browser.newPage();
await page.setViewport({ width: 1440, height: 1000 });
const response = await page.goto(url, {
waitUntil: 'networkidle2',
timeout: 60000,
});
if (!response || !response.ok()) {
throw new Error(`Page load failed: ${response?.status() ?? 'no response'}`);
}
await page.pdf({
path: 'page.pdf',
format: 'A4',
printBackground: true,
preferCSSPageSize: true,
margin: {
top: '12mm',
right: '12mm',
bottom: '12mm',
left: '12mm',
},
});
} finally {
await browser.close();
}
This is an adaptable workflow, not a guarantee for every site. networkidle2 is a navigation wait condition, not proof that an application-specific chart or data request has completed. Some pages maintain network connections, load data later, require authentication, or animate content. For those pages, wait for a signal that belongs to the site—for example, a known report element to appear or an application-specific ready state—before calling page.pdf(). The available documentation does not establish one universal readiness signal for every JavaScript page.
Choose PDF options deliberately
The Puppeteer 25.12.0 PDFOptions interface documents controls including format, landscape orientation, margins, background printing, page ranges, scale, and whether CSS @page size takes precedence. Set only what the document needs, and check how the chosen options interact with the page’s print CSS.
Free tools Windows power users keep installed
One-click scans. No signup required.
Best Value
- HP LaserJet M209dw Wireless Printer, Print, Fast speeds, Easy setup, Mobile printing, Best-for-small teams, Instant Ink eligible
- Perfect for small teams printing black & white documents and reports, plus auto two-sided printing. Perfect for 1-5 people
- FASTEST TWO-SIDED PRINTING IN ITS CLASS – Up to 30 black-and-white pages per minute single-sided, u up to 19 black-and-white images per minute two-sided printing
- DUAL-BAND WI-FI WITH SELF-RESET – Automatically detects and resolves connectivity issues
- STRONG SECURITY – Built-in security features help protect your printer from potential attacks
- Paper size: Choose a format that fits the content, or define page size in CSS and enable
preferCSSPageSizewhen CSS should take precedence. - Orientation: Use
landscape: truefor a wide layout when that makes the chart or table more readable. Check the resulting text size. - Backgrounds: Use
printBackground: truewhen the PDF needs background graphics; print color handling is a separate concern. - Margins and scale: Adjust them to prevent clipping without shrinking labels until they are hard to read.
- Page ranges: Generate only the pages needed when the document is large and the range is known.
When the page should use screen styles rather than print styles, emulate the screen media type before page.pdf(). That changes which CSS applies; it does not make a PDF behave like an interactive webpage.
Troubleshoot missing, clipped, or unexpected output
- Chart is blank or missing: The chart may not have finished loading or rendering before printing. Wait for its data and a page-specific ready condition; for Chart.js, apply the documented print resize pattern and re-check the preview.
- Chart is clipped or distorted: Print layout may have changed the canvas display area without a matching canvas resize. Check the container’s print width and use a library-specific resize approach rather than relying on CSS sizing alone.
- Wide chart is too small: Try landscape orientation, a more suitable page size, or a layout that gives the chart more width. Inspect label legibility before accepting the PDF.
- Colors or backgrounds differ: Print rendering can modify colors. For Puppeteer, confirm whether
printBackgroundshould be enabled and whether print-color adjustment is appropriate for the page. - PDF is incomplete despite navigation succeeding: The page may fetch data or render assets after the navigation wait condition has completed. Wait for an application-specific signal before creating the PDF.
- Content breaks across pages awkwardly: Adjust print CSS, margins, and page-break behavior, then preview the document. A print rule cannot ensure identical pagination across all browser versions and content.
Or skip the browser setup
If your goal is to capture a rendered page rather than build your own browser automation, ScreenshotNeo is a website screenshot API and MCP server. One GET request can return a screenshot or PDF. Its clean-shot process accepts consent banners as a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each of those steps can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing, and responses identify the page verdict and billing status. Its MCP server offers take_screenshot, get_page_info, and capture_pdf for AI agents and MCP clients.
Here is the one-call cURL example for a rendered page screenshot. See the ScreenshotNeo documentation for PDF output and other request options.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com/report -o shot.webp
The Free plan includes 1,000 shots a month without a card; paid plans start at $5 for 3,000 shots. Sign up for ScreenshotNeo’s free plan.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problemsInspect the PDF before relying on it
Open the saved file at its intended page size and confirm that charts, labels, color, page breaks, and required content are correct. Browser print layout, chart resizing, and the assets a page loads can all affect the result; no single set of settings guarantees identical output for every site.
Frequently Asked Questions
Can I use Puppeteer to create a PDF with screen CSS instead of print CSS?
Yes. Call page.emulateMediaType('screen') before page.pdf().
Does the PDF keep a chart interactive?
No. A PDF is document output; it does not preserve the webpage’s interactive behavior.
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.
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 →

