Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchPC 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 & 11Chrome’s documented --headless --print-to-pdf command saves a PDF, but its current command-line reference does not document paper-width or paper-height switches. To control the page size, generate the PDF with Puppeteer’s page.pdf() or the Chrome DevTools Protocol’s Page.printToPDF. Use CSS @page rules when the document should own its page geometry, and enable preferCSSPageSize so the browser honors them.
Set a paper size with Puppeteer
Pass dimensions to page.pdf(). Puppeteer accepts numbers or strings with units for width and height. This example selects A4 portrait dimensions directly:
As an Amazon Associate I earn from qualifying purchases.
await page.pdf({
path: 'output.pdf',
width: '210mm',
height: '297mm',
});
When you supply dimensions directly and want them to determine the output, leave preferCSSPageSize unset or set it to false. If it is true, a CSS @page size takes priority over width, height, or format. See the Puppeteer PDFOptions reference.
Use a named paper format
For a named format supported by Puppeteer, use format rather than specifying both dimensions:
#1 Best Overall
- 1 ream (500 sheets) of 8.5 x 11 white copier and printer paper for home or office use
- Multipurpose letter size copy paper works with laser/inkjet printers, copiers and fax machines
- Smooth 20lb weight paper for consistent ink and toner distribution; dries quickly and resists paper jams
- Bright white paper (92 GE; 104 Euro) offers great contrast for crisp printing and vivid color
- Virgin copy paper providing professional quality results; acid-free to prevent yellowing
await page.pdf({
path: 'output.pdf',
format: 'A4',
});
Choose either a named format or explicit dimensions according to your application. If you need a custom size or choose dimensions dynamically per request, set width and height.
Set paper dimensions through the Chrome DevTools Protocol
With CDP, call Page.printToPDF and pass paperWidth and paperHeight in inches. The protocol documents defaults of 8.5 inches wide by 11 inches high. For example, these values are approximately A4 dimensions:
Rank #2
- HP Papers is sourced from renewable forest resources and has achieved production with 0% deforestation in North America. Each ream is wrapped in a polyurethane coated paper wrapper to protect the cut sheets from moisture damage
- Sheet size – 8.5 x 11; Thickness – 20 pounds; Brightness – 92 bright white
- HP Copy&Print20 20 pounds printer paper is Forest Stewardship Council (FSC) certified and contributes toward satisfying credit MR1 under LEED (Leadership in Energy and Environmental Design)
- All HP Papers provide premium performance on HP equipment, as well as on all other printer and copier equipment; 100% satisfaction guaranteed; ColorLok technology provides more vivid colors, bolder blacks and faster drying
- Superior quality, reliability, and dependability for high-volume printing at home, at school and in the office; HP Copy&Print20 print and copy paper prevents yellowing over time to ensure a long-lasting appearance for added archival quality
{
"paperWidth": 8.27,
"paperHeight": 11.69,
"preferCSSPageSize": false
}
The numbers are inches, not millimeters. Replace them with the dimensions your application requires. The CDP Page domain reference documents the method, defaults, and CSS-size preference.
Let print CSS control the page size
Use an @page rule when page geometry belongs with the document’s print styles—for example, when the same stylesheet defines the layout and paper size:
Rank #3
- PREMIUM PRINTER PAPER – Hammermill Premium Inkjet & Laser 24lb Printer Paper is a versatile sheet that’s perfect for double-sided inkjet or laser printed projects. With a 97 brightness & blue-white shade, you get consistently sharp, clear images.
- COLORLOK TECHNOLOGY – This computer paper features ColorLok Technology for colors that are 30% brighter, blacks that are 60% bolder and ink that dries 3x faster. This white copy paper will provide consistently superior results.
- PERFECT FOR PRINTING – This multi-purpose copier paper is designed to run smoothly through all office equipment for professional results when printing newsletters, flyers, reports, memos, and more. It’s also acid-free paper to prevent yellowing over time.
- SUSTAINABLY MADE IN THE USA – Original Hammermill printer paper is Forest Stewardship Council (FSC) certified, which means they are made with renewable resources from third-party certified, sustainably managed forests.
@page {
size: A4 portrait;
margin: 12mm;
}
Then give CSS page sizing priority in Puppeteer:
await page.pdf({
path: 'output.pdf',
preferCSSPageSize: true,
});
For CDP, set preferCSSPageSize: true in the Page.printToPDF parameters as well. With the documented default of false, content is scaled to fit the paper size selected by the PDF options (or their defaults); CSS page size does not take priority. See the Puppeteer options and the CDP protocol reference.
Choose who owns the dimensions
- CSS-owned: Declare
@page { size: ... }and enablepreferCSSPageSize. This suits documents whose print stylesheet should define page geometry. - Caller-owned: Supply dimensions in Puppeteer or CDP. This suits a rendering service that selects page dimensions for each request.
Do not enable CSS priority accidentally: when it is true, CSS can override dimensions you passed to the PDF API.
Rank #4
- MADE IN USA - HP Papers is sourced from renewable forest resources and has achieved production with 0% deforestation in North America. See images.
- OPTIMIZED FOR HP TECHNOLOGY - All HP Papers provide premium performance on HP equipment, as well as on all other printer and copier equipment. 100% satisfaction . See images.
- PERFECT OFFICE PAPER WHEN YOU NEED TO PRINT COLOR DOCUMENTS - HP All-In-One22 is thicker, brighter and whiter than ordinary multipurpose printing papers and is optimized for all inkjet and laser printers and copiers.
- CERTIFIED SUSTAINABLE - HP All-In-One22 22lb printer paper is Forest Stewardship Council (FSC) certified and contributes toward satisfying credit MR1 under LEED (Leadership in Energy and Environmental Design). See images.
- COLORLOK TECHNOLOGY PRINTING PAPER - Colorlok technology provides more vivid colors, bolder blacks and faster drying. See images.
Understand print media and page layout
Puppeteer’s page.pdf() uses the print CSS media type. If the output should use screen styles instead, call page.emulateMediaType('screen') before generating the PDF:
Free tools Windows power users keep installed
One-click scans. No signup required.
await page.emulateMediaType('screen');
await page.pdf({ path: 'output.pdf', width: '210mm', height: '297mm' });
Media selection controls which CSS rules lay out the page; it is separate from choosing paper dimensions. For print-specific layout, keep the default print media and define print rules such as @page. See Puppeteer’s Page.pdf() documentation.
Best Value
- 3 ream case (1,500 sheets) of 8.5 x 11 white copier and printer paper for home or office use
- Multipurpose letter size copy paper works with laser/inkjet printers, copiers and fax machines
- Smooth 20lb weight paper for consistent ink and toner distribution; dries quickly and resists paper jams
- Bright white paper (92 GE; 104 Euro) offers great contrast for crisp printing and vivid color
- Virgin copy paper providing professional quality results; acid-free to prevent yellowing
What the headless Chrome command line can set
The documented CLI pattern is --headless --print-to-pdf. The current Chrome Headless command-line reference also documents --timeout, which controls the maximum wait before printing, and --no-pdf-header-footer to suppress PDF headers and footers. It notes that older Chrome versions may use the prior --print-to-pdf-no-header flag. The reference does not document CLI switches for paper width or height, so use Puppeteer or CDP when dimensions must be set programmatically.
Troubleshoot unexpected PDF dimensions
- The PDF ignores the supplied width or height: Check whether
preferCSSPageSizeis true. If CSS should not override API dimensions, remove it or set it tofalse; if CSS should win, check the document’s@pagerule. - The CDP output is the wrong size: Confirm that
paperWidthandpaperHeightare in inches, not millimeters. - Content looks scaled or does not fit as expected: With CSS priority off, the protocol scales content to fit the selected paper dimensions. Review the selected dimensions and whether CSS page sizing should instead take priority.
- The PDF uses the wrong styling: Puppeteer prints with the
printmedia type by default. If you specifically need screen rules, callpage.emulateMediaType('screen')beforepage.pdf(). - A CLI flag for paper size has no effect: Paper-dimension switches are not documented in the current CLI reference. Set the size through Puppeteer or CDP instead.
These references track current Chrome, CDP, and Puppeteer documentation and may change. Check the documentation for the versions deployed in your environment before relying on version-sensitive behavior.
Or skip the browser setup
If you need a PDF from a URL rather than a custom Puppeteer or CDP workflow, ScreenshotNeo provides a screenshot and PDF API. One GET request can return a PDF; the API also supports paper size, margins, landscape orientation, and page ranges. It does not replace a workflow that requires your own browser automation code.
cURL example, adapted to request a PDF for the target URL:
Quick Recap
curl -G "https://api.screenshotneo.com/v1/shot"
-d access_key=YOUR_API_KEY
--data-urlencode url=https://stripe.com
-d format=pdf
-o document.pdf
See the ScreenshotNeo API documentation for request parameters. ScreenshotNeo removes supported cookie banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, and failed loads are not billed. Its MCP server lets AI agents take screenshots. The Free plan includes 1,000 shots per month with no card, and paid plans start at $5 for 3,000 shots. Sign up for ScreenshotNeo’s free plan.
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.




