The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.
Use two separate controls: add --no-pdf-header-footer to remove Chrome’s generated date, URL and page-number furniture, and set @page { margin: 0; } (or Puppeteer’s PDF margins) to remove the page inset. If whitespace remains, it is probably in the webpage’s own CSS or content rather than the PDF page margin.
First identify which “margin” you are seeing
Headless Chrome can produce several visually similar kinds of blank space. The correct fix depends on what is actually present in the PDF.
Chrome-generated header and footer
A date, page number, URL or similar text at the top or bottom is browser-generated print furniture. Disable it with --no-pdf-header-footer on the command line or displayHeaderFooter: false in Puppeteer.
PDF page margins
If the whole page content is inset from every edge, set the print page margin to zero with CSS or Puppeteer’s margin option.
#1 Best Overall
- INNOVATIVE CARTRIDGE-FREE PRINTING — No more dealing with lots of tiny ink cartridges; With this wireless document and photo printer each ink bottle set is equivalent to about 90 individual cartridges²
- LESS FREQUENT INK REPLACEMENT — Replacement ink bottles don't have to be changed nearly as often as ink cartridges¹; When you choose this combination printer, scanner and copier you can print up to 4,500 pages black/7,500 color³
- COLOR PRINTING — Up to 2 years of ink in the box4 (and with every replacement ink set) for fewer out-of-ink frustrations
- ZERO CARTRIDGE WASTE — By using an Epson EcoTank printer you can help reduce the amount of cartridge waste ending up in landfills
- HOME PRINTER DESIGNED FOR RELIABILITY — The Epson EcoTank ET-2800 All-in-One Supertank Color Printer creates vivid, detailed prints and documents thanks to Micro Piezo Heat-Free Technology; Fire off 10 ISO pages per minute1 to easily finish large jobs
Whitespace in the webpage
Body padding, element margins, fixed-width wrappers, or deliberate blank sections remain part of the rendered document. PDF margin settings do not remove spacing that belongs to the HTML.
Whitespace already embedded in source content
If you are loading an existing PDF or an image containing white borders, changing Chrome’s print settings cannot crop those pixels. The controls below affect a new PDF generated from the page.
Remove Chrome’s generated header and footer from the CLI
Pass the dedicated switch when invoking Headless Chrome:
chrome --headless --print-to-pdf --no-pdf-header-footer https://example.com/
--print-to-pdf creates output.pdf by default. The --no-pdf-header-footer switch suppresses Chrome’s automatically generated header and footer, including the date, URL and page number documented in Chrome’s command-line reference (Headless CLI documentation).
Use the executable name installed on your system, such as chrome or chromium. If the switch appears to do nothing, check the installed version: Chrome documents --print-to-pdf-no-header as the older name used by previous versions.
Rank #2
- CARTRIDGE-FREE PRINTING — Print lab-quality photos, graphics and creative projects; Get vibrant colors and sharp text with Epson's high-accuracy printhead and Claria ET Premium 6-color inks
- INK BOTTLES — Save on photos1 and creative projects with affordable in-house printing; All-in-one printer allows you to print 4" x 6" photos for about 4 cents each vs. 40 cents with traditional ink cartridges1
- LESS FREQUENT INK REPLACEMENT — Replacement ink bottles don't have to be changed nearly as often as ink cartridges¹; Printer, scanner and copier lets you print up to 6,200 color pages³
- PRINT FOR LONGER — Up to 2 years of ink in the box² (and with every replacement ink set) for fewer out-of-ink frustrations with this wireless printer
- ZERO CARTRIDGE WASTE — Epson EcoTank printer helps reduce the amount of cartridge waste ending up in landfills; Cartridge-free printer uses high-yield ink bottles; Each replacement ink bottle set is equivalent to about 100 individual ink cartridges⁴
Set the printed page margin to zero with CSS
Add a print rule to the page being rendered:
@media print {
@page {
margin: 0;
}
}
The @page rule controls the printed page box and its margins without changing the ordinary screen layout. CSS print-margin behavior is described in Chrome’s guide to printed page margins (Chrome print margins).
Keep the rule in a print stylesheet or inside @media print so normal browser viewing is unaffected. A zero page margin does not cancel spacing declared elsewhere. For example, these rules still create visible gaps:
@media print {
body { margin: 24px; }
.report { padding: 16px; }
h1 { margin-top: 32px; }
}
Remove or adjust those declarations only if they are the source of the whitespace you want to eliminate. Also inspect pseudo-elements, empty containers, absolute-positioned elements and fixed-width layouts that may reserve space.
Generate a margin-free PDF with Puppeteer
Puppeteer exposes both controls through its PDF options. Set all four page margins explicitly and disable generated header/footer output:
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch({ headless: true });
const page = await browser.newPage();
await page.goto('https://example.com/');
await page.pdf({
path: 'output.pdf',
margin: {
top: '0',
right: '0',
bottom: '0',
left: '0'
},
displayHeaderFooter: false
});
await browser.close();
})();
These option names and types are defined by Puppeteer’s maintained PDFOptions API. Confirm the reference that matches the Puppeteer release in your project if an older dependency behaves differently.
Rank #3
- SET IT UP ONCE AND PRINT WITH CONFIDENCE. No complicated maintenance. Just easy, reliable printing you can count on.
- INK FOR YEARS. NOT MONTHS. Up to 2 years of ink included. Get thousands of pages of cartridge-free printing. More pages, less hassle
- KEEPS PRINTING WELL AFTER COMPETITORS HAVE QUIT. No complex maintenance. Sharper text, richer colors.[2] Only with HP Smart Tank
- PREMIUM SUPPORT - Strong technical expertise to solve issues faster
- THE LAST PRINTER YOU'LL EVER NEED. Enjoy years of refillable, cartridge-free printing.
Why set every side?
A single shorthand value is easy to misread when code is maintained. Explicit top, right, bottom and left values make the intended output clear and prevent a nonzero side from surviving in a shared configuration object.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Clear out junk files and repair common Windows errors3Scan for outdated or missing drivers - takes under a minuteWhen to use a nonzero margin
Use a measured margin when text, tables or graphics need breathing room for readability, binding or later annotation. Zero is appropriate for edge-to-edge designs only when the page content has been designed and tested for that geometry.
How the two controls interact
| Goal | Control | What it changes | Important qualification |
|---|---|---|---|
| Remove Chrome-added date, URL and page number | --no-pdf-header-footer |
Chrome process behavior | Previous Chrome versions may use --print-to-pdf-no-header. |
| Remove the printed page inset | @page { margin: 0; } |
HTML/CSS print layout | Body and element spacing remains. |
| Control both from application code | Puppeteer margin plus displayHeaderFooter: false |
Puppeteer PDF generation | Use option names supported by your installed Puppeteer version. |
Chrome’s print-margin guidance notes that browser-generated header/footer content is omitted when page margins are zero or too small to leave room for it. Rely on the explicit header/footer switch or Puppeteer option when that is the material you want gone; use the margin setting for the page geometry itself.
Check paper size, scale and overflow before shipping
Removing margins changes the available content area and can alter pagination. Verify the result with the paper size and scale used by your production job, not only with a quick local preview.
- Inspect the first and last page for clipped text, borders and positioned elements.
- Check long tables, flex or grid layouts and images that can extend beyond the page box.
- Compare a short page and a multi-page page; a layout that looks correct on one page can introduce an unexpected break later.
- Preview the output in the same Chrome or Puppeteer version used in deployment.
A zero margin places content at the edge of the PDF page. It does not guarantee that every element will fit inside that edge, so test pages with the largest headings, widest tables and longest paragraphs in your application.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Rank #4
- Wireless Bluetooth Printer: Portable thermal printer compatible with iPhone, Android phones, iPad and tablet computers via Bluetooth. For smartphones, please download the "Nada Print" App. You can also connect to laptops and computers for printing using a USB-C cable. (Note: Laptops and computers can only be connected via USB and require the installation of a driver first. Bluetooth connection is not supported.)
- No-ink printing: Only supports US Letter and A4 size thermal paper.(Doesn't support regular paper) The no-ink portable thermal printer uses direct thermal technology, requiring no ink, toner or ribbons, making it environmentally friendly, cost-effective and time-saving. The thermal printer package comes with a roll of US Letter thermal printing paper. Note: When installing the paper, remember to switch the paper size switch on APP
- Clear Print: NDYIN N80 portable thermal printer adopts high-definition printing technology, with a 203DPI resolution to provide you with clear printing results. This mobile printer is compatible with roll paper, folded paper and tattoo transfer paper, supporting printing from your mobile phone PDF, Word, pictures and web pages anytime and anywhere. It is recommended to use our NDYIN thermal paper to achieve good printing quality
- Portable wireless printer for travel: The thermal printer is equipped with a built-in 1500mAh rechargeable battery, which can print 160 sheets of 8.5" x 11" thermal paper after being fully charged. It weighs only 1.5 pounds and is compact in size. This ink-free portable printer can be easily carried in a backpack or briefcase! It is perfect for business travel, cars, small offices, construction sites, schools and homes. You can print documents, contracts, invoices and boarding passes anytime and anywhere
- The N80 thermal printer has a wide range of uses. The package includes the N80 printer, a roll of US Letter paper(7m/roll), a user manual, a guide card, a type-C soft cable and a type C adapter. Note: The charging adapter is not included. Special thermal paper is required for use; ordinary paper cannot be used. This ink-free portable thermal printer is suitable for various scenarios such as home, school, travel, office, and outdoor, meeting the printing needs of different groups of people. This tattoo template printer is also compatible with tattoo transfer paper, making it an ideal choice for tattoo art
Troubleshooting common results
| Symptom | Likely cause | Fix |
|---|---|---|
| Date, URL or page number is still visible | Generated header/footer is enabled, or the flag is not recognized. | Use --no-pdf-header-footer or Puppeteer’s displayHeaderFooter: false. Check whether an older Chrome requires --print-to-pdf-no-header. |
| Content is evenly inset on all sides | Print page margins are nonzero. | Set @page { margin: 0; } or all four Puppeteer margin values to '0'. |
| Top spacing remains after margins are zero | The page itself adds body padding, heading margin or wrapper padding. | Inspect computed styles under print media and remove only the declarations creating the unwanted gap. |
| Only one component has a blank area | The component’s dimensions, padding or an empty child reserves space. | Inspect that component’s print CSS and its rendered box; PDF page-margin settings do not change it. |
| Content is clipped at the edge | Zero margins changed the available geometry or an element overflows its page. | Check paper size, scale, element dimensions and pagination; add a small intentional margin if the design requires safe space. |
| The CLI option has no effect | Version-specific flag behavior or a different Headless binary. | Record the Chrome version and executable, try the documented legacy flag for older releases, and generate a fresh PDF. |
Headless Chrome version considerations
Chrome’s Headless documentation distinguishes the unified current Headless mode from the old implementation. Since Chrome 132.0.6793.0, the old Headless mode is available only as the standalone chrome-headless-shell binary. Do not assume that behavior observed with that shell is identical to the current Chrome binary; record which executable and version produced the PDF when diagnosing differences (Chrome Headless mode documentation).
A repeatable production checklist
- Open the PDF and identify whether the blank area is browser furniture, page margin or page content.
- Disable generated furniture with
--no-pdf-header-footerordisplayHeaderFooter: false. - Set
@pagemargins or Puppeteer’s four margin values explicitly. - Render with print media and inspect body, wrapper and component spacing.
- Test paper size, scale, pagination and overflow using the deployed Chrome/Puppeteer version.
- Keep a small representative PDF in automated checks so a browser upgrade cannot silently restore headers or margins.
Or skip the browser setup
If your requirement is a clean capture of a live webpage rather than custom control of your own Chrome print stylesheet, ScreenshotNeo provides a website screenshot API that can return PNG, JPEG, WebP or PDF. It accepts the page before capture like a visitor, removes cookie and consent banners, newsletter popups and chat widgets, and lets you control those cleanup steps.
One GET request is enough:
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 output and capture options. The same request in Python is:
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
And in Node.js:
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
- Bot checks, CAPTCHAs, blank pages, timeouts, failed loads and cache hits are not billed; response headers identify the page verdict and billing status.
- An MCP server supplies
take_screenshot,get_page_infoandcapture_pdftools to Claude, Cursor and other MCP clients. - The Free plan includes 1,000 screenshots each month without a card. Paid plans start at $5 for 3,000 screenshots, and every feature is available on every plan.
Create a free ScreenshotNeo account to start with 1,000 screenshots a month and no card.
Frequently Asked Questions
What does the bare --print-to-pdf command create?
Chrome writes a file named output.pdf by default when no output filename is supplied.
Can these settings crop white borders from an existing PDF?
No. The CLI, CSS and Puppeteer controls affect PDF generation from the page; whitespace already embedded in source content requires a separate post-processing workflow.
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.

