ScreenshotNeo

BlogHTML to image & PDF

How to Save a Webpage as a PDF When a Cookie Banner Covers the Content

Save a webpage to PDF even when a cookie banner obscures it. Start with browser print preview, then try reader modes or a screenshot API if needed.

By the ScreenshotNeo team4 October 20269 min read

Short answer: Open the browser’s print preview, choose Save as PDF or Save to PDF, and inspect the preview before saving. A cookie banner may still appear in the PDF; browser print settings do not provide a universal remove-banner switch. If it remains, use the site’s consent controls, try a reading or simplified-print view where available, or capture the page with a screenshot tool that removes consent overlays.

Print output can differ from the page on screen. The browser steps below are supported routes to a PDF, not a guarantee that a particular site’s banner will be omitted. Mozilla notes that pages can be arranged differently for paper than on screen.

1. Save the page from browser print preview

Chrome on Windows or Linux

  1. Open the webpage and wait for its main content to load.
  2. Press Ctrl+P, or choose File → Print.
  3. In the destination list, choose Save as PDF.
  4. Review every preview page. Check whether the banner covers text, whether content is missing, and whether images appear.
  5. Adjust options such as paper size, layout, margins, scale, and background graphics if needed, then save.

Chrome documents printing through its print window, where you select the destination and settings. The separate More → More tools → Save page as command saves a webpage rather than directly creating a PDF. See Google’s Chrome printing instructions.

Chrome on Mac

Open print preview with Command+P or File → Print, choose Save as PDF, inspect the preview, and save.

Firefox desktop

  1. Open the Firefox menu and choose Print, or press Ctrl+P on Windows/Linux or Command+P on Mac.
  2. Set Destination to Save to PDF.
  3. Review the preview and adjust orientation, page range, color, paper size, scale, margins, headers and footers, or backgrounds as appropriate.
  4. If offered, try Format → Simplified and inspect the result. Simplified format is conditional and may not be available on every page.
  5. Choose Print and save the generated PDF.

Firefox’s current print options are described in Mozilla Support.

Microsoft Edge

Press Ctrl+P on Windows or Command+P on Mac, or open the menu and choose Print. Choose the PDF destination available in the dialog, check the preview, and save. Edge also supports printing from the page context menu. Its settings can include paper size, pages, margins, scale, and background graphics; the available choices may depend on platform. See Microsoft’s Edge printing guide.

Safari on Mac

Use File → Print (or Command+P), then use the macOS print dialog’s PDF save option. Check the preview for the banner before saving. Safari Reader is available for supported articles and can reduce surrounding distractions, but it is not available for every webpage and is not a guaranteed cookie-banner remover. Apple explains Safari’s Reader website settings.

2. If the banner is still in the preview

  1. Try the banner’s own controls. If the site offers a close button or consent choices, use the controls you prefer. Then reopen print preview and check again. This may change what is displayed, but it is not a guaranteed change to print output.
  2. Try a reading or simplified view. Firefox offers Simplified format when available; Safari Reader works on supported articles. Edge documents Immersive Reader as a clutter-free printing workaround where available. Availability varies by site, and none should be treated as universal banner removal.
  3. Check the actual PDF preview, not just the page. A banner may be fixed to the screen, repositioned in print layout, or still cover content. Confirm that required text and images are present before saving.
  4. Use a content-editing method only if necessary. Mozilla mentions the Firefox extension Print Edit WE for editing webpage content before printing. Review an extension’s permissions and suitability before installing it.

Do not clear all cookies as the first fix. That can sign you out and remove saved site preferences, while it does not guarantee a cleaner PDF. Google’s cookie guidance describes these effects.

3. Choose print settings for a readable PDF

Setting When to change it What to check
Orientation Use landscape for wide tables or diagrams. Text should remain readable and not be clipped.
Paper size Choose a standard size suitable for reading or printing. Changing paper size can repaginate the page.
Scale Reduce scale if content is cut off; increase it only if the preview remains within page boundaries. Small scale can make text hard to read.
Margins Adjust when content is too close to an edge or uses too much blank space. Zero margins can clip content in some layouts.
Background graphics Enable if background colors or graphics convey meaning. Backgrounds can increase ink use or make text less legible.
Headers and footers Enable if you need page numbers or the page URL/date. They consume space and may add browser-generated details.
Pages Select a range when only part of the document is needed. Confirm the preview page numbers match the intended range.

For an archive or citation, preserve the source URL separately if the PDF printout does not include it. A PDF is a snapshot of rendered output, not necessarily a complete copy of the site’s underlying assets or interactive behavior.

4. Developer workflow: create a PDF from a page

For a one-off, browser print preview is simplest. For repeatable captures, use a browser automation library and print the page to PDF. This example uses Playwright with Node.js. It waits for the page to load, gives delayed content a short settling window, hides a known banner selector, and writes a PDF. Replace the selector with the actual consent element on the target site. Hiding an overlay in a local capture is not equivalent to recording consent or changing the site’s consent state.

import { chromium } from 'playwright';

const url = 'https://example.com/article';
const bannerSelector = '.cookie-banner';

const browser = await chromium.launch({ headless: true });
try {
  const page = await browser.newPage();
  await page.goto(url, { waitUntil: 'networkidle', timeout: 60_000 });
  await page.locator(bannerSelector).evaluateAll(elements => {
    for (const element of elements) element.remove();
  }).catch(() => {}); // Selector may not exist on every page.
  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();
}

Install the dependency with npm install playwright and install its browser with npx playwright install chromium. If the page uses a known consent platform, target its actual banner container and validate the resulting document. Avoid broad selectors such as div or aside, which can remove real content. For a site you control, a print stylesheet using @media print is more robust than runtime selector removal.

  • Consent is stored in browser state: a banner may return in a fresh browser context. Decide whether the workflow should preserve the current session or start clean.
  • Banner is inside an iframe: a top-level selector will not reach into a cross-origin iframe. If you control the site, adjust its print styles or banner implementation.
  • Content loads late: network idle may never occur on pages with analytics or long polling. Use a specific content selector or a bounded delay instead of waiting indefinitely.
  • Lazy-loaded images: scroll through the page before printing or wait for the relevant images to load; otherwise a PDF can omit below-the-fold assets.
  • Very long page: prefer normal paginated PDF output to a single giant image when selectable text and manageable file size matter.
  • Protected or authenticated page: automation must have authorized access and the required session cookies. Do not put credentials in source code or logs.

5. Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server from Yorker Media. It can return a PDF in one request; read the API documentation for the available parameters. For a page you are authorized to capture:

curl -G "https://api.screenshotneo.com/v1/shot" \
  -d access_key=YOUR_API_KEY \
  --data-urlencode url=https://stripe.com \
  -d format=pdf \
  -o page.pdf

Cookie banners, popups, and chat widgets are removed before the shot, and each step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing; response headers identify the page verdict and billing status. An MCP server lets AI agents using Claude, Cursor, or another MCP client take screenshots. The free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots. PDF options include paper size, margins, landscape, and page ranges. See the docs for exact request options.

Create a free ScreenshotNeo account to get 1,000 screenshots a month with no card.

6. Troubleshooting

Problem Likely reason Fix
The cookie banner still covers the PDF The site’s print layout includes the banner, or the browser did not apply a reading view. Use the banner controls, try a supported Reader/Simplified mode, inspect the print preview again, or use a capture workflow that can remove overlays.
Some text or images are missing Print CSS hides elements, content has not loaded, or images are lazy-loaded. Wait for content, scroll to load images, check page range and preview, and try the original format instead of Simplified.
Text is tiny or clipped Scale, margins, paper size, or orientation do not fit the layout. Try landscape for wide content, increase usable width, reduce scale moderately, and inspect each page.
Colors or diagrams disappear Background graphics are disabled or a simplified format removed styling. Enable background graphics if available and switch back to original formatting.
PDF save option is missing Destination options differ by operating system or managed browser setup. Look for the operating system print dialog’s PDF menu, or use another supported desktop browser’s print-to-PDF flow.
Automation waits forever The page keeps network connections open or never reaches network idle. Wait for a meaningful content selector with a timeout, then proceed or report a controlled failure.
Automation removes page content The selector matches more than the banner. Inspect the site DOM and narrow the selector to the consent container; verify the output before relying on it.
The banner returns after clearing cookies The site no longer has its previous stored preference. Use the site’s controls if desired. Clearing cookies is not required to create a PDF and can remove sign-ins or preferences.

7. Performance, reliability, and cost

For a single document, native print preview has no separate capture service or automation runtime to configure. Its main reliability limit is that the website controls its print layout, so preview inspection is essential. Browser automation is repeatable, but adds browser installation, page-load waits, selector maintenance, and the need to manage session state and failures.

Keep automated jobs bounded with navigation and selector timeouts, and save only after required content is present. For batches, log the source URL, capture time, chosen settings, and a success/failure result; avoid logging access tokens or sensitive page content. PDF size and processing time grow with page length, images, and background graphics. ScreenshotNeo pricing is usage-based by the stated plan allowances: free 1,000/month, Starter $5 for 3,000, Growth $15 for 15,000, Pro $39 for 60,000, Scale $99 for 250,000, and Business $249 for 1,000,000; yearly billing gives two months free. Every feature is on every plan. Use the plan that matches your actual capture volume rather than assuming every attempted capture is billable.

Frequently asked questions

Do I have to accept cookies to save a PDF?

No. A browser’s PDF workflow does not require accepting cookies. Choose how to interact with the site’s consent controls according to your preference.

No. Reader or simplified modes are conditional on browser and page support, and banner behavior is site-specific.

Can I save a page as a PDF on a phone?

Mobile print and sharing options vary by browser and operating system. The steps here focus on desktop, where print preview exposes the destination and layout controls most directly.

Is a PDF the same as saving the webpage?

No. A PDF preserves a rendered document layout; a webpage save or web archive is a different format and may preserve different resources and behavior.