Yes—you can automate a report’s image and PDF outputs from the same controlled browser render. The reliable sequence is to open the report in Chromium, wait for its data, charts, tables, and fonts, capture either the viewport, a selected element, or the full page, then export a PDF with the media mode and color settings that match your intended output. Playwright and Puppeteer both support this workflow; the practical choice depends on your language, browser coverage, and how your team wants to maintain the automation.
What the automation should do
A production capture job normally performs these actions in order:
- Start a known Chromium (or another supported browser) version in a controlled context.
- Open the report URL with the required authentication, cookies, headers, viewport, timezone, and locale.
- Wait for the application’s own “ready” condition—not merely navigation—to confirm that data, charts, tables, images, and web fonts are available.
- Capture the required visual scope as PNG, JPEG, or WebP.
- Export the same rendered page to PDF, selecting print or screen media deliberately.
- Write deterministic filenames and retain logs, status, and the input parameters with the artifacts.
A navigation event can finish while a client-side report is still fetching data. Add an application-specific locator, completion flag, or network-idle rule, and use a bounded timeout so a broken report cannot hold a worker indefinitely.
Choose viewport, element, or full-page capture
Viewport screenshot
A viewport screenshot records exactly what is visible in the browser window. Use it for a dashboard tile, a hero section, or a reproducible “above the fold” image. Set the viewport width and height explicitly so runs on different machines produce the same composition.
Free tools Windows power users keep installed
One-click scans. No signup required.
#1 Best Overall
- CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
- INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
- THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
- WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
- A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents
Element screenshot
Capture a chart, table, or report card by locator or CSS selector when the surrounding navigation and page chrome are irrelevant. Element capture avoids extra whitespace and makes a useful image for a document or ticket. Ensure the element is visible and has finished layout before capturing it.
Full-page screenshot
A full-page image includes the complete scrollable document rather than only the current viewport. It is useful for an audit trail or a long report preview, but very tall pages can produce large raster files. Consider splitting a very long report into logical sections or using PDF as the primary artifact.
Playwright: complete Node.js workflow
Install Playwright and its browser binaries:
npm install playwright
npx playwright install chromium
The following script waits for a report-specific readiness marker, captures a full-page WebP image, and writes a PDF. Replace the URL, selector, and authentication setup with your application’s values.
const { chromium } = require('playwright');
(async () => {
const browser = await chromium.launch({ headless: true });
const context = await browser.newContext({
viewport: { width: 1440, height: 1000 },
deviceScaleFactor: 1,
colorScheme: 'light'
});
const page = await context.newPage();
try {
await page.goto('https://example.com/report/123', {
waitUntil: 'domcontentloaded',
timeout: 60000
});
// Replace this with a marker your app sets after data and charts render.
await page.locator('[data-report-ready="true"]').waitFor({
state: 'visible',
timeout: 60000
});
await page.evaluate(() => document.fonts.ready);
await page.screenshot({
path: 'report-full.webp',
fullPage: true,
type: 'webp'
});
// PDF defaults to print CSS. Use screen media when visual screen styling is required.
await page.emulateMedia({ media: 'screen' });
await page.pdf({
path: 'report.pdf',
format: 'A4',
printBackground: true,
margin: { top: '12mm', right: '12mm', bottom: '12mm', left: '12mm' }
});
} finally {
await browser.close();
}
})();
Playwright’s screenshot API supports a filename, image type, viewport capture, element capture, full-page capture, and high-resolution output. For an element image, use await page.locator('.report-chart').screenshot({ path: 'chart.png' }). For a viewport image, omit fullPage or set it to false. A PDF is returned or written by page.pdf().
Use a deliberate readiness signal
Have the report application set a marker after its data request resolves and the chart library finishes drawing, for example:
document.documentElement.dataset.reportReady = 'true';
Then wait for html[data-report-ready="true"]. If you cannot add a marker, wait for a stable table row count, a chart canvas, or a selector that only appears after rendering. A fixed delay is a fallback, not proof that asynchronous work is complete.
Rank #2
- CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
- 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
- SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
- INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
- THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
Puppeteer: complete Node.js workflow
Install Puppeteer, which downloads a compatible browser for normal use:
npm install puppeteer
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch({ headless: true });
const page = await browser.newPage();
await page.setViewport({ width: 1440, height: 1000, deviceScaleFactor: 1 });
try {
await page.goto('https://example.com/report/123', {
waitUntil: 'domcontentloaded',
timeout: 60000
});
await page.waitForSelector('[data-report-ready="true"]', {
visible: true,
timeout: 60000
});
await page.evaluate(() => document.fonts.ready);
await page.screenshot({ path: 'report.png', fullPage: true });
// Puppeteer uses print media for PDF unless you select screen media.
await page.emulateMediaType('screen');
await page.pdf({
path: 'report.pdf',
format: 'A4',
printBackground: true,
margin: { top: '12mm', right: '12mm', bottom: '12mm', left: '12mm' }
});
} finally {
await browser.close();
}
})();
Puppeteer’s PDF method is intended for printing PDFs. Its screenshot method can write an image or return a buffer; add fullPage: true for the complete scrollable page. If you need a particular chart, select its element and call that element’s screenshot method.
PDF fidelity: why colors and layout change
Print CSS is the default
PDF generation uses print media by default in both frameworks. Print styles may hide navigation, change dimensions, remove backgrounds, or alter page breaks. That is useful for a deliberately designed printable report but surprising when you expect the screen to be reproduced.
Select screen media when screen appearance matters
Call Playwright’s page.emulateMedia({ media: 'screen' }) or Puppeteer’s page.emulateMediaType('screen') before page.pdf(). Keep printBackground: true when colored panels, chart fills, or shaded table cells are part of the report.
Preserve colors intentionally
Chromium’s print pipeline can adjust colors. A print stylesheet can include -webkit-print-color-adjust: exact for elements whose colors must be retained, while still testing whether the resulting contrast is suitable on paper. Do not assume that a screen screenshot and a PDF will have identical pagination: PDF layout is page-based and responds to paper size, margins, and break rules.
Wait for fonts and images
Use document.fonts.ready and wait for report images or chart completion. Capturing before fonts load can change line wrapping and move page breaks. Lazy-loaded images may require scrolling or an application-level “all assets loaded” signal before capture.
Rank #3
- Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
- Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
- Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
- In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
- Ultra-thin bezels: Maximize your viewing experience with thin bezels.
Authentication, deterministic rendering, and repeatable files
Authentication
For protected reports, authenticate in the browser context using a login flow, a saved storage state, cookies, or request headers. Keep secrets outside source code and CI logs. Confirm that the final page is the report—not a login screen—before writing artifacts.
Control rendering inputs
- Set viewport dimensions and device scale factor explicitly.
- Fix timezone, locale, and color scheme when dates or formatting affect the report.
- Use a known browser version and install it during deployment.
- Disable animations or wait for them to finish so captures do not land mid-transition.
- Use stable test data when visual diffs must be meaningful.
Store useful metadata
Use a filename containing the report identifier, date, and format, such as sales-2026-09-29-full.webp and sales-2026-09-29.pdf. Store the URL, viewport, browser version, commit identifier, and readiness outcome beside the files. This makes a visual discrepancy diagnosable instead of mysterious.
Common failures and fixes
The image is blank or shows a spinner
Cause: capture started after navigation but before client-side data arrived. Fix: wait for a report-specific completion marker, verify the API response, and fail if the marker does not appear before the timeout.
The PDF omits backgrounds or screen-only controls
Cause: print CSS is active or backgrounds are disabled. Fix: select screen media, enable printBackground, and review the report’s print stylesheet.
Recommended Free Tools
Charts are missing
Cause: the chart library has not painted, the chart is below a lazy-load threshold, or a canvas is resized after capture. Fix: wait for a chart-ready selector or a stable canvas size; scroll lazy sections into view when required; then capture.
Fonts change between runs
Cause: web fonts were not ready or a different browser image is being used. Fix: await document.fonts.ready, package or preload required fonts, and pin the browser version.
Rank #4
- CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
- SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
- MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
- KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
- INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient
The script times out
Cause: a slow dependency, blocked request, authentication redirect, or never-set readiness marker. Fix: inspect the final URL and console/network errors, raise the timeout only for a justified slow path, and make the job fail with a clear diagnostic rather than producing a partial report.
Very tall pages produce oversized images
Cause: full-page rasterization stores every pixel in one file. Fix: capture key elements, divide the report into sections, reduce the image scale when acceptable, or distribute the report as PDF.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →PDF page breaks split tables or cards
Cause: the print layout does not define page-break behavior. Fix: add print-specific break rules, choose an appropriate paper size and margin, and test with the longest realistic dataset.
Performance and reliability decisions
There is no universal speed or quality winner between Playwright and Puppeteer from their capability documentation. Measure your own report, browser, data source, and concurrency. Reuse a browser process where safe, but isolate contexts so cookies and report data cannot leak between jobs. Limit concurrent pages to the capacity of your worker and upstream services. Cache immutable assets, but never cache user-specific report data accidentally.
For reliable jobs, retry only transient navigation or upstream failures; do not blindly retry a deterministic selector timeout. Record whether the failure occurred during navigation, readiness, screenshot, or PDF generation. Compare images or PDFs against approved baselines when layout regressions matter, while allowing for intentionally changing dates and live metrics.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Or skip the browser setup
ScreenshotNeo provides a hosted screenshot API and MCP server when you want a one-request capture instead of maintaining Chromium workers. Its endpoint can return PNG, JPEG, WebP, or PDF, with options for full-page and element captures, custom CSS and JavaScript, waits, headers, cookies, user agents, PDF margins and page ranges, signed links, asynchronous jobs, and bulk capture.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Repair Windows errors before they cause bigger problems3Scan for outdated or missing drivers - takes under a minuteBest Value
- 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
- 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
- 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.
Cookie banners, newsletter popups, and chat widgets are removed before the shot. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and the response identifies the page verdict and billing status in headers. AI agents can use the MCP tools take_screenshot, get_page_info, and capture_pdf.
cURL:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
Python:
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)
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}`);
See the complete parameter reference in the ScreenshotNeo documentation. The Free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000. Create a free ScreenshotNeo account.
Frequently Asked Questions
Can one job create both a screenshot and a PDF?
Yes. Capture the image and call the framework’s PDF method after the same page has reached its readiness condition.
Should I use Playwright or Puppeteer?
Use the runtime and browser coverage your team already supports. Their screenshot and PDF capabilities overlap substantially, so workload-specific maintainability matters more than an assumed performance winner.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →How do I capture only a chart?
Wait for the chart’s completed state, select its locator or CSS selector, and call the element screenshot method instead of full-page capture.
Why does a PDF look different from a screenshot?
PDF uses print media by default and paginates content. Select screen media when needed, enable backgrounds, and define print-specific page-break and color rules.
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.

