Free tools Windows power users keep installed
One-click scans. No signup required.
Set the margin option in the options object passed to page.pdf(). Give each side its own unit-bearing value for predictable page padding:
await page.pdf({
path: 'output.pdf',
margin: {
top: '1in',
right: '0.75in',
bottom: '1in',
left: '0.75in',
},
});
Set each PDF margin independently
Puppeteer’s PDFOptions accepts a margin object with top, right, bottom, and left values. Each side is optional in the API type, but specifying all four avoids relying on implicit values when you need a consistent layout.
As an Amazon Associate I earn from qualifying purchases.
Use strings with explicit units, such as '1in' or '12mm'. The API reference describes the accepted values as strings or numbers, but does not specify numeric-value units in the cited material, so unit-bearing strings make the intended measurement clear.
Example with four sides
await page.pdf({
path: 'output.pdf',
margin: {
top: '1in',
right: '0.75in',
bottom: '1in',
left: '0.75in',
},
});
The margin option defaults to undefined, which means no margins are set. Do not omit it if the PDF needs deliberate padding.
#1 Best Overall
Choose paper size and CSS page dimensions
The documented default paper format is Letter. If the document is intended for another paper size, such as A4, set a format in the same page.pdf() options object. Paper size and margins jointly determine the available content area.
await page.pdf({
path: 'output.pdf',
format: 'A4',
margin: {
top: '20mm',
right: '15mm',
bottom: '20mm',
left: '15mm',
},
});
If your stylesheet defines page dimensions with CSS @page, consider preferCSSPageSize. It defaults to false; setting it to true gives the CSS page size priority over the PDF options width, height, or format. Decide which source should control the paper dimensions rather than assuming both will apply independently.
Rank #2
- HTML CSS Design and Build Web Sites
- Comes with secure packaging
- It can be a gift option
Choose print or screen styles before generating the PDF
page.pdf() uses the print media type by default. If the PDF should use your screen styles instead, set the media type before calling page.pdf():
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Fix the driver behind crashes, sound loss and screen glitches3Repair Windows errors before they cause bigger problemsawait page.emulateMediaType('screen');
await page.pdf({
path: 'output.pdf',
margin: {
top: '1in',
right: '0.75in',
bottom: '1in',
left: '0.75in',
},
});
Media type affects which CSS rules render; paper format, CSS page dimensions, and margins affect the PDF’s page layout. Check the CSS and PDF options together when the result differs from the browser view.
Rank #3
Troubleshoot unexpected margins or page layout
- No visible padding: confirm that
marginis present in the options passed directly topage.pdf(). Leaving it out means Puppeteer sets no margins. - One edge is wrong: inspect the matching side key—
top,right,bottom, orleft—and use an explicit unit-bearing string. - Wrong paper dimensions: remember the documented default is Letter. Set
formatto the intended size, or usepreferCSSPageSize: truewhen CSS@pagedimensions should take priority. - PDF styling differs from the page in a browser: PDF generation uses print media by default. Call
page.emulateMediaType('screen')first only when screen styles are desired.
The Puppeteer API references establish the option names and defaults, but do not guarantee a particular rendered result across browser or Puppeteer versions. Check the documentation matching your installed Puppeteer version; the cited API reference pages identify PDFOptions v25.12.0 and PDFMargin v25.9.0 in their search results.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Or skip the browser setup
If you need a screenshot or PDF of a web page rather than control of a Puppeteer workflow, ScreenshotNeo offers a one-request screenshot API and an MCP server for AI agents. Its PDF options include paper size, margins, landscape orientation, and page ranges.
Rank #4
- Brand: Wiley
- Set of 2 Volumes
- A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers
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 request options. ScreenshotNeo accepts cookie or consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers report the page verdict and billing status. 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 with no card; paid plans start at $5 for 3,000 shots.
Recommended Free Tools
Sign up for 1,000 free screenshots a month with no card.
Quick Recap
Best Value
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.




