Free tools Windows power users keep installed
One-click scans. No signup required.
Use Puppeteer’s page.pdf() method to turn rendered HTML into a PDF. It produces a print-oriented document with selectable text in typical cases, but “editable” can mean several different things: changing the original HTML, selecting or searching text in the PDF, or filling interactive form fields. Puppeteer’s documented PDF workflow is a print-rendering path; its documentation does not promise that HTML form controls become fillable PDF fields. Choose the workflow based on which kind of editing you need.
What “editable PDF” means in a Puppeteer workflow
Before writing code, decide what the recipient must be able to do. The word “editable” is often used for three separate requirements, and they do not produce the same file:
- Edit the source: You can revise the HTML, CSS, and data, then generate a new PDF. The PDF itself is not the editable source document.
- Select or search text: Puppeteer renders the page to PDF using its print path. Text is generally represented as text rather than a screenshot, but verify the specific PDF if text extraction, accessibility, or copying is a requirement.
- Fill in fields inside the PDF: This requires interactive PDF form fields. The Puppeteer
Page.pdf()documentation describes PDF printing and layout options, but does not document converting HTML<input>,<select>, or<textarea>elements into fillable AcroForm widgets. Do not assume HTML controls will become interactive fields.
If you need fillable fields, use a PDF form-field authoring or post-processing step, then test the result in the actual viewers your recipients use. The Puppeteer documentation reviewed here does not establish that its print path creates such fields. See the Puppeteer PDF generation guide and PDFOptions reference.
Generate a PDF from HTML with Puppeteer
Install Puppeteer in a Node.js project, provide markup to a page, wait for its resources as appropriate, and call page.pdf(). This ES module example writes the returned PDF bytes to a file:
Recommended Free Tools
#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
import puppeteer from 'puppeteer';
import { writeFile } from 'node:fs/promises';
const html = `<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Monthly report</title>
<style>
@page { size: A4; margin: 18mm; }
body { font: 12pt/1.5 Arial, sans-serif; color: #222; }
h1 { break-after: avoid; }
.new-page { break-before: page; }
@media print {
a { color: inherit; }
}
</style>
</head>
<body>
<h1>Monthly report</h1>
<p>This text is generated from HTML and CSS.</p>
</body>
</html>`;
const browser = await puppeteer.launch();
try {
const page = await browser.newPage();
await page.setContent(html, { waitUntil: 'networkidle0' });
const pdf = await page.pdf({
format: 'A4',
printBackground: true,
preferCSSPageSize: true,
margin: { top: '18mm', right: '18mm', bottom: '18mm', left: '18mm' },
});
await writeFile('report.pdf', pdf);
} finally {
await browser.close();
}
page.setContent() sets the page’s markup; page.pdf() returns a Uint8Array of PDF data. The code above is an implementation pattern, not a claim of a tested execution. Puppeteer’s official references explain the content-loading method and PDF method.
For HTML already hosted at a URL
If the document is available from a web application, navigate to it instead of calling setContent():
await page.goto('https://example.com/report', { waitUntil: 'networkidle0' });
const pdf = await page.pdf({ format: 'A4', printBackground: true });
Replace the example URL with your page. Use an application-controlled URL or authenticate and pass only the necessary credentials; avoid exposing secrets in a URL or in logs. A navigation wait condition is a signal about page loading, not proof that every delayed image, animation, or application-specific task has finished. If the page loads resources after the network becomes quiet, wait for a meaningful selector or application-ready condition before printing.
Control print layout with CSS and PDF options
Puppeteer generates PDFs using print CSS by default. Set page dimensions and print-specific presentation in CSS when those rules should travel with the HTML, and use PDF options for output-level controls. The documentation lists these relevant options:
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
| Need | Setting | Effect and consideration |
|---|---|---|
| Paper size | format |
Choose a supported format such as 'A4'. The documented default is Letter. |
| Portrait or landscape | landscape |
Set to true for landscape orientation. |
| Margins | margin |
Specify top, right, bottom, and left margins using supported length values. Coordinate these with CSS @page rules to avoid unexpected whitespace. |
| Background fills and images | printBackground |
Set to true to include printed backgrounds; the documented default is false. |
| CSS-defined page size | preferCSSPageSize |
When enabled, CSS @page dimensions take priority over the dimensions implied by the PDF options or format. |
| Scale | scale |
Adjust rendered content scale. The documented default is 1; the valid range is 0.1 to 2. |
| Selected pages | pageRanges |
Restrict output to specified page ranges when only part of a long document is needed. |
| Headers and footers | displayHeaderFooter, headerTemplate, footerTemplate |
Enable and provide printed header/footer content. Check the resulting spacing and page numbering in the output. |
Use PDFOptions for the exact option types supported by the version you install. Avoid setting CSS page dimensions and PDF dimensions independently without deciding which should win; with preferCSSPageSize enabled, CSS page size takes priority.
Page breaks, colors, and screen styling
Use print styles for document-specific behavior such as page breaks, hiding navigation, and avoiding a heading stranded at the bottom of a page. For example:
@media print {
nav, .screen-only { display: none; }
h2, h3 { break-after: avoid; }
.keep-together { break-inside: avoid; }
.start-new-page { break-before: page; }
* { -webkit-print-color-adjust: exact; }
}
Colors are adjusted for print by default. The Puppeteer PDF guide points to -webkit-print-color-adjust when exact colors are required. Exact-color output can consume more ink when printed and may still vary by viewer or printer, so inspect the PDF rather than relying only on a browser preview. If the desired PDF should use screen rather than print styles, call await page.emulateMediaType('screen') before page.pdf(); otherwise print media is the default.
Wait for fonts, images, and application content
A PDF can be produced before all the content you expect is ready if your page depends on external fonts, images, scripts, or asynchronous data. Puppeteer’s PDF options default waitForFonts to true, but that is not a substitute for ensuring the page itself has reached the right state. The PDF options timeout is documented as 30,000 milliseconds; slow external resources can therefore affect completion.
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
- For self-contained HTML with no external assets,
page.setContent()may be enough. - For ordinary network-loaded assets, choose a navigation or content wait condition suitable for the page.
networkidle0can be useful, but pages with persistent connections or ongoing requests may not reach it. - For a single critical image or component, wait for a selector that indicates it is ready, or use an application-specific readiness signal.
- For fonts, leave
waitForFontsenabled unless you have a reason not to, and ensure external font hosts are reachable from the browser process. - For lazy-loaded content, scroll or otherwise trigger the application’s loading behavior before printing; a full-page PDF does not guarantee that content which has never loaded will appear.
Choose a browser version compatible with Puppeteer
Puppeteer’s browser support mapping is versioned and changes over time. The support page lists Puppeteer 25.12.0 alongside Chrome for Testing 154.0.8037.57 and Firefox 156.0.1; treat those as the versions stated on that page, not as a permanent compatibility promise. Puppeteer says it has downloaded and worked with Chrome for Testing since v20.0.0. Check the official support table against the Puppeteer version in your project, especially if you configure an arbitrary system browser instead of Puppeteer’s supported browser setup.
Troubleshoot common PDF-generation problems
The PDF is blank or missing recent data
Likely cause: Printing began before client-side rendering or data loading completed. Fix: Wait for a page-specific ready selector or application signal after navigation, then generate the PDF. Confirm that the page has the expected content before calling page.pdf().
Fonts or images are missing
Likely cause: An external asset failed, loaded too late, or was not triggered by lazy loading. Fix: Check asset URLs and browser access, wait for required fonts and images, and trigger lazy content before printing. If the page uses remote resources, make sure the rendering environment can reach them.
Background colors are absent
Likely cause: PDF background printing is off by default. Fix: Set printBackground: true. If colors are still adjusted for printing, use the documented print CSS color adjustment and verify in the target viewer.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
Paper size or margins do not match expectations
Likely cause: The stylesheet’s @page size conflicts with the PDF options, or print margins were not considered in the design. Fix: Choose a single intended page-size source; enable preferCSSPageSize when CSS dimensions should win, and inspect the output after adjusting margins.
The PDF call times out
Likely cause: Slow font or page resource loading, or a page that never reaches the selected readiness condition. Fix: Identify which resource or wait condition stalls, make readiness specific to the required content, and configure an appropriate PDF timeout using the options supported by your installed Puppeteer version. Do not treat a longer timeout as a fix for a page that never becomes ready.
HTML fields are not fillable in the PDF
Likely cause: The print-to-PDF rendering path is not documented as an HTML-to-AcroForm conversion workflow. Fix: Add a PDF form-field generation or post-processing stage and test the final file in the viewers recipients use. If the requirement is only to revise the content later, retain and edit the HTML source, then regenerate the PDF.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Performance, reliability, and cost considerations
For repeated document generation, reuse browser processes where your application architecture allows it, but create an appropriate page per job and close pages and browsers reliably. The example uses try/finally so the browser is closed even if rendering or writing fails. Bound concurrency according to the memory and CPU available to your deployment: a page with large images, complex scripts, or many pages costs more resources than a simple document. Measure your own workload; the cited Puppeteer documentation does not establish a universal throughput figure or hosting cost.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteBest Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
Keep HTML and assets deterministic where possible, pin the Puppeteer dependency, and check its supported browser mapping when updating. For production, handle rejected navigation, PDF timeouts, and file-write errors explicitly, and avoid returning a partial or stale PDF as though generation succeeded. The output is PDF bytes; your application is responsible for storing or serving them with the correct content type and access controls.
Or skip the browser setup
If your actual goal is a clean screenshot or PDF capture of a public webpage rather than a custom HTML-to-PDF pipeline, ScreenshotNeo offers a one-request API. It is not a replacement for Puppeteer when you need to render supplied HTML with the print CSS and layout code above, or when you require custom PDF form fields. Its API accepts a URL and can return a screenshot or PDF. The example below uses the supplied screenshot request form to save a WebP capture of Stripe; see the ScreenshotNeo documentation for the API’s PDF and other options.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
ScreenshotNeo accepts cookie or consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each step can be turned off. Bot checks, blank pages, failed loads, timeouts, and cache hits are not billed, with response headers indicating the page verdict and billing status. It also provides an MCP server for AI agents, and its 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. Sign up free for 1,000 screenshots a month with no card.
Frequently Asked Questions
Does Puppeteer generate a PDF directly from an HTML string?
Yes. Set the markup with `page.setContent(html)` and then call `page.pdf()`.
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Clear out junk files and repair common Windows errors3Fix the driver behind crashes, sound loss and screen glitchesCan I use Puppeteer to make a fillable PDF form?
Puppeteer’s documented print-to-PDF workflow does not promise conversion of HTML form controls into interactive PDF fields. Use a PDF form authoring or post-processing step if recipients must fill fields.
Does `page.pdf()` use screen styles or print styles?
It uses print styles by default. Call `page.emulateMediaType(‘screen’)` first if the PDF should reflect screen styling.
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.

