How to Capture a Webpage as a PDF with a Dark Background
Save a dark webpage as a PDF by enabling background printing, then check the preview for readable text, colors, and page breaks.
To save a webpage as a PDF with its dark background, open the browser’s Print dialog, enable Print backgrounds or Background graphics, inspect the preview, then save to PDF. A dark browser theme only changes browser controls and does not necessarily make webpage backgrounds print. The page’s own print styles can also change its appearance, so check the preview before saving.
Save the webpage with a dark background
- Open the webpage you want to save.
- Open the browser’s Print dialog: usually Ctrl+P on Windows or Command+P on macOS.
- Enable the setting for printing backgrounds. Its name depends on the browser.
- Inspect the preview. Check that the dark background appears, text and links remain legible, and page breaks do not cut off important content.
- Select the browser’s PDF destination or Save to PDF, then save the file.
Printing backgrounds preserves background graphics where the browser and page allow it; it does not guarantee a pixel-identical copy of the screen. Websites can apply print styles that alter colors, hide elements, or reflow the page.
Browser settings
Microsoft Edge
Open Print with Ctrl+P on Windows or Command+P on macOS. Expand More settings and select Background graphics. Microsoft recommends this setting when the preview or output differs from the webpage. Check the preview, then print to a PDF destination. Microsoft’s Edge printing instructions.
Firefox
Open Print, choose Save to PDF as the destination, expand More settings, and enable Print backgrounds. Do not select Simplified format if you need background printing: Mozilla says that option is unavailable in Simplified format. Review the preview and save. Mozilla’s Firefox printing instructions.
Chrome and dark mode
Chrome’s dark theme can make parts of the browser, such as the toolbar and settings, dark. That setting is separate from printing a webpage’s background and does not establish that page backgrounds will appear in a PDF. Use the Print dialog’s preview to determine what the page will look like. Google’s description of dark mode and dark theme.
Print settings and page behavior can vary. If your browser offers a background-printing option, enable it and verify the result in the preview rather than assuming that browser dark mode controls the PDF.
Make the PDF readable
- Check contrast. A dark background can make dark text hard to read, and a print stylesheet may change text color without changing the background.
- Review page breaks. Long pages can split headings, code samples, tables, or images across pages. Adjust paper size, scale, margins, or page ranges if the dialog offers those controls.
- Compare preview and saved file. The preview is a useful check, but open the saved PDF too if the colors or layout matter.
- Look for print-specific page changes. Pages may intentionally use a different print layout, omit interactive controls, or hide backgrounds.
Troubleshooting
| Symptom | Likely cause | What to try |
|---|---|---|
| The PDF has a white background. | Background printing is off, or the page’s print styles remove its screen background. | Enable Background graphics in Edge or Print backgrounds in Firefox, then inspect the preview. If it stays white, the page may be using print styling that changes its appearance. |
| The browser is dark but the PDF is light. | The browser’s dark theme affects browser controls, not necessarily webpage print output. | Enable background printing for the page and check its print preview. |
| The background option is missing or unavailable in Firefox. | Mozilla documents that Simplified format disables Print backgrounds. | Turn off Simplified format, then check More settings again. |
| The page looks different from the screen. | The site may supply print-specific styles, or the print layout may reflow the content. | Inspect the preview and review the saved PDF. Browser print output is not guaranteed to match the on-screen page exactly. |
| Text is difficult to read on the dark page. | Foreground and background colors may not retain sufficient contrast in print output. | Check the preview. If the site’s print styles produce a more legible result, use that output; otherwise, consider saving a screen capture or asking the site for a print-friendly version. |
Or skip the browser setup
ScreenshotNeo is a website screenshot API and MCP server. It can return screenshots or PDFs; see the API documentation for PDF options. For a PDF request, set the documented PDF output option for the endpoint:
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
import requests
r = requests.get(
"https://api.screenshotneo.com/v1/shot",
params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com", "format": "pdf"},
timeout=90,
)
r.raise_for_status()
open("page.pdf", "wb").write(r.content)
const q = new URLSearchParams({
access_key: 'YOUR_API_KEY',
url: 'https://stripe.com',
format: 'pdf'
});
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`ScreenshotNeo request failed: ${res.status}`);
await import('node:fs/promises').then(fs => fs.writeFile('page.pdf', Buffer.from(await res.arrayBuffer())));
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, and failed loads are never billed. Its MCP server lets AI agents take screenshots. The free plan includes 1,000 screenshots a month with no card, and paid plans start at $5 for 3,000. Sign up free for 1,000 screenshots a month, no card required.
Performance, reliability, and cost
Browser printing is convenient for an occasional page and uses the browser you already have. For a long page, allow time for the content to load before opening Print, then check that lazy-loaded content appears in the preview. Background graphics can use more ink if printed on paper; for a PDF, the main trade-off is file appearance and readability.
For repeatable captures or automated workflows, an API avoids manually opening the print dialog for every URL. With ScreenshotNeo, only clean shots are billed: bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers report the page verdict and billing status. Plans include Free (1,000 shots/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, and every feature is on every plan. Confirm PDF output and page appearance with the docs and a preview appropriate to your use case.
FAQ
Does dark mode make a webpage PDF dark?
Not by itself. Browser dark mode can change browser controls, while webpage print output is controlled by print settings and the page’s print behavior.
Will enabling backgrounds make every page look exactly like the screen?
No. It enables background printing, but websites can use print styles that change appearance and layout.
Can I save only selected pages?
Use the page-range control in the print dialog if your browser provides one, then confirm the selected pages in the preview.


