iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
For a PDF already displayed in a browser viewer, use Playwright’s ordinary page screenshot after the viewer has rendered: await page.screenshot({ path: 'screenshot.png' }). This captures the visible browser page, not a guaranteed image of every page in the PDF. Playwright’s Page API documentation also warns that “Headless mode doesn’t support navigation to a PDF document.” If you need a particular PDF page or the complete document, use a PDF-rendering workflow with explicit page control instead of relying on fullPage.
Take a screenshot of the PDF viewer currently on screen
If the PDF is already open in a browser viewer, capture the page after the viewer has rendered. The standard Playwright screenshot API captures the current page viewport:
await page.screenshot({ path: 'screenshot.png' });
For example, if your own application serves an HTML page that embeds a PDF viewer, navigate to that HTML page and capture it:
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minutePC 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 & 11const { chromium } = require('playwright');
(async () => {
const browser = await chromium.launch();
try {
const page = await browser.newPage();
await page.goto('https://example.com/pdf-viewer', { waitUntil: 'load' });
await page.screenshot({ path: 'screenshot.png' });
} finally {
await browser.close();
}
})();
Replace the example URL with your viewer page. A successful call means Playwright wrote a screenshot of what that browser page exposed at capture time; inspect the resulting image to verify the PDF surface is visible in your browser configuration.
#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
Choose the capture method for the result you need
One visible viewport
Use page.screenshot() with no fullPage option when you want the visible viewer, including its current zoom, scroll position, and controls. The capture reflects the current browser state; it does not advance through the PDF or assemble document pages.
The full scrollable HTML page
For a normal web page, Playwright supports fullPage: true:
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
await page.screenshot({ path: 'page.png', fullPage: true });
This option captures the full scrollable web page. It is not documented as a way to enumerate or capture every sheet in a built-in PDF viewer. Whether any embedded viewer surface appears in the result depends on what the page and browser expose, so check the output rather than assuming it contains the whole document.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
A specific element in an HTML viewer
If the PDF viewer is implemented in HTML and exposes a stable element for the displayed page, you can capture that element:
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.
await page.locator('.pdf-page').screenshot({ path: 'pdf-page.png' });
Replace .pdf-page with a selector that exists in your viewer. The generic locator screenshot API does not guarantee access to native browser PDF viewer controls or their rendered page surface. Confirm the selector resolves and inspect the image.
Every page or a specific PDF page
If the deliverable must contain a chosen PDF page or all PDF pages, use a workflow that explicitly renders PDF pages, such as an HTML PDF viewer you control or a process that exports individual page images. A browser-page screenshot does not provide that document-level selection or pagination guarantee.
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
Direct navigation to a PDF has a headless-mode limitation
The Playwright Page API documentation states: “Headless mode doesn’t support navigation to a PDF document.” This warning is specifically about navigating directly to a PDF in headless mode. It does not establish that every screenshot operation fails in every browser mode, nor does it give a universal recipe for capturing a built-in viewer. For an existing viewer page, verify behavior in the browser mode and configuration used by your project. The official Playwright API and screenshot documentation were checked on 2026-10-03; the pages are rolling documentation without a displayed publication date, so recheck them when updating Playwright.
Do not confuse a screenshot with PDF generation
page.pdf() creates a PDF from a webpage; it is not the method for producing a PNG of a PDF viewer. By default, PDF generation uses print CSS. If you need it to use screen media instead, call page.emulateMedia({ media: 'screen' }) before page.pdf(). For an image of the browser viewer, use page.screenshot().
Best 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.
Troubleshoot missing or incomplete captures
- The PDF is blank or still loading: capture only after the viewer has rendered its page. A navigation event such as
loaddoes not itself guarantee that a viewer has finished drawing its content; inspect the screenshot and use a viewer-specific readiness condition where available. - Direct PDF navigation fails in headless mode: this is the limitation documented by Playwright. Navigate to an HTML viewer page you control, or use a PDF-rendering workflow that gives explicit control over the pages.
fullPage: trueomits document pages: that option targets full scrollable web content, not a promise to capture all pages of a PDF. Render the needed PDF page or pages explicitly.- An element screenshot errors or is empty: confirm that your locator matches the rendered HTML element and that the viewer exposes the page surface in the DOM. Native viewer internals may not be available through a generic locator.
- The image shows the wrong portion of the document: a viewport screenshot captures the viewer’s current state. Set the viewer’s page, zoom, and scroll position before capturing, then verify the output.
Or skip the browser setup
If you need a screenshot of a URL without managing Playwright and a browser, ScreenshotNeo offers a one-request screenshot API. This captures a web page; it is not a substitute for explicitly rendering every page of a PDF document.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com/pdf-viewer -o shot.webp
See the ScreenshotNeo API documentation for request options. ScreenshotNeo removes cookie banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, and failed loads are never billed. It also has an MCP server for AI agents, and the free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000. Learn about ScreenshotNeo, or sign up for 1,000 free screenshots a month with no card.
Visual regression testing
For a Playwright Test visual check, expect(page).toHaveScreenshot() is an assertion that waits for two consecutive screenshots to match before comparing the result with the expected snapshot. It can help detect changes in the viewer’s rendered appearance, but it does not change the distinction between a browser-page screenshot and explicit rendering of PDF document pages.
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 →Frequently Asked Questions
Can Playwright capture a PDF already shown in the browser?
It can capture the browser page with page.screenshot(); verify that the viewer surface appears in the target browser configuration.
Does fullPage: true capture every page of a PDF?
No such guarantee is documented. It captures the full scrollable web page, not necessarily every PDF page.
Does page.pdf() make an image of the PDF viewer?
No. It generates a PDF from a webpage. Use page.screenshot() for a screenshot image.
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.
Recommended Free Tools

