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 →Short answer: Puppeteer’s emulated viewport and a PDF’s paper geometry are independent. Set the device’s CSS-pixel viewport (and, separately, deviceScaleFactor), choose screen or print CSS, then define PDF paper dimensions with format, width/height, or CSS @page. Use PDFOptions scale only for PDF rendering scale; it is not a device-pixel-ratio control.
The three controls you must keep separate
A reliable device-sized PDF starts by separating three stages of Chromium’s pipeline:
- Viewport emulation:
widthandheightare CSS pixels.deviceScaleFactordescribes the emulated display density and does not choose PDF paper size. - CSS media:
page.pdf()uses theprintmedia type by default. If the PDF should look like the screen, callpage.emulateMediaType('screen')before creating it. - PDF page and rendering:
format,width,height, CSS@page,preferCSSPageSize, and PDFscalecontrol the output document.
Changing only the viewport will not make a PDF page physically match that viewport. Conversely, increasing PDF scale will not emulate a higher-density phone display.
A complete Puppeteer implementation
This example emulates a 390 × 844 CSS-pixel mobile device, keeps screen styles, and creates a PDF page with the same nominal CSS dimensions.
#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch({headless: true});
const page = await browser.newPage();
// Device metrics are CSS pixels; DPR is a separate property.
await page.setViewport({
width: 390,
height: 844,
deviceScaleFactor: 3,
isMobile: true,
hasTouch: true
});
await page.goto('https://example.com', {
waitUntil: 'networkidle2',
timeout: 60000
});
// PDF defaults to print CSS. Select screen CSS explicitly when required.
await page.emulateMediaType('screen');
await page.pdf({
path: 'device-viewport.pdf',
width: '390px',
height: '844px',
preferCSSPageSize: true,
scale: 1,
printBackground: true,
margin: {top: '0px', right: '0px', bottom: '0px', left: '0px'}
});
await browser.close();
})();
Replace the URL with your page and adjust the dimensions to the target profile. The values above illustrate how the settings relate; they are not a universal conversion for every stylesheet or desired paper format.
Set the intended device before navigation
Some sites choose layout, scripts, or resources during the first navigation. Configure the viewport before goto() so the page sees the intended metrics from the start. page.emulate(device) is a shortcut that applies a device’s user agent and viewport and resizes the page; use it before navigation when using a built-in device descriptor.
const devices = require('puppeteer').KnownDevices;
await page.emulate(devices['iPhone 13']);
await page.goto(url, {waitUntil: 'networkidle2'});
If you need a custom profile, use setViewport(). Remember that mobile layout also depends on the document’s viewport meta tag. A page without an appropriate <meta name="viewport"> can render with a layout viewport that does not resemble the physical device you had in mind.
Choose screen or print CSS deliberately
Screen-style output
Call await page.emulateMediaType('screen') immediately before page.pdf(). This selects the screen media rules but does not set paper dimensions, margins, or PDF scale.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Print-style output
Do nothing when print styling is desired: PDF generation uses print CSS by default. Check @media print rules for hidden navigation, changed colors, or altered widths before diagnosing a sizing problem as a viewport issue.
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
Backgrounds and pagination
Set printBackground: true when colors and background images matter. For long pages, use normal pagination and inspect page breaks; a device-shaped page can still produce many PDF pages if its content exceeds the selected height.
Define PDF paper dimensions
Use a named format
format: 'A4', 'Letter', and other supported formats are convenient for documents intended for printers. When format is present, it takes priority over width and height.
Use explicit width and height
For a viewport-shaped page, provide CSS lengths such as width: '390px' and height: '844px'. You can use units such as in, cm, or mm when the output has a physical paper requirement.
Let CSS choose the page size
Declare the intended page in your stylesheet:
@page {
size: 390px 844px;
margin: 0;
}
html, body {
margin: 0;
}
Then set preferCSSPageSize: true. Its documented default is false; with the default, Chromium scales content to fit the PDF paper size instead of giving CSS page size priority.
Understand PDF scale versus device scale factor
PDFOptions scale is a rendering adjustment with a documented range of 0.1 to 2 and a default of 1. It can make content fit or occupy more of a page, but it does not increase the emulated viewport’s CSS-pixel density. Keep deviceScaleFactor at the value needed to reproduce responsive or DPR-dependent behavior, and change PDF scale only after verifying media type, page dimensions, margins, and CSS page-size precedence.
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
There is no universal formula that converts a phone’s DPR into a correct PDF scale. A page’s CSS, paper units, fonts, images, and Chromium version all affect the result. Generate representative files and inspect their actual dimensions and line wrapping.
Options that commonly affect apparent size
margin: Nonzero margins reduce the usable content area and can trigger fitting or extra pages.printBackground: Required when visual comparison depends on background paint.displayHeaderFooter: Headers and footers consume space and can change pagination.pageRanges: Useful for exporting selected pages while debugging a long document.landscape: Rotates standard paper formats; it does not rotate the emulated viewport.waitForFontsand application readiness: Wait for fonts, images, and client-side layout before capture so late reflow does not look like a scaling defect.
A repeatable sizing workflow
- Write down the target device’s CSS viewport width and height, DPR, mobile flag, and user agent.
- Apply those metrics (or
page.emulate()) before navigation. - Navigate with an explicit readiness condition such as
networkidle2, a selector, or an application-specific promise. - Decide whether the PDF should use print or screen CSS.
- Choose one paper strategy: a named format, explicit dimensions, or CSS
@pagewithpreferCSSPageSize: true. - Set margins and background printing intentionally.
- Start with PDF
scale: 1. Change it only when the page geometry is otherwise correct. - Compare PDFs for every supported profile, including narrow and wide breakpoints, long content, and pages with lazy-loaded images.
Troubleshooting mismatched PDFs
Everything is desktop-sized
Check that the viewport was set before goto(), that the mobile flag and user agent are correct, and that the page has a suitable viewport meta tag. A PDF paper setting cannot force responsive CSS to select a mobile breakpoint.
Free tools Windows power users keep installed
One-click scans. No signup required.
Screen styles are missing
Call emulateMediaType('screen') before pdf(). If print rules still appear, confirm no later code switches the media type.
The page is unexpectedly shrunk
Look for format overriding width and height, nonzero margins, and preferCSSPageSize: false. Remove format when explicit dimensions should win, or enable CSS page-size preference.
Content is clipped or split
Inspect the selected page height, CSS @page rules, fixed-position elements, and overflow containers. A viewport height is not a guarantee that all document content fits on one page.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
Images or fonts change after capture
Wait for the relevant network requests or DOM state, preload critical fonts, and ensure lazy content has been triggered. Capture only after layout is stable.
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 minuteChanging DPR has no visible PDF effect
That is expected when the page does not use DPR-dependent assets or CSS. DPR affects emulation; PDF paper and PDF scale remain separate.
Performance, reliability, and cost considerations
Emulating a larger DPR can increase raster work and memory use, especially on image-heavy pages, but it does not replace selecting an appropriate PDF page size. Reuse a browser process for batches, close pages when finished, and apply navigation and capture timeouts. For reproducibility, pin the Puppeteer/Chromium version used in CI and keep viewport, media type, paper dimensions, margins, and scale in configuration rather than scattering them through scripts.
Validate at least one short page, one long page, a page with web fonts, and a page with responsive images. Store the chosen profile alongside the PDF so a later change in CSS or Chromium can be traced to a specific setting.
Or skip the browser setup
ScreenshotNeo provides a one-request screenshot API when you need an image rather than a locally managed Puppeteer PDF pipeline. It accepts consent banners as a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each cleanup step can be disabled. Bot checks, CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and the response identifies the result with X-Page-Verdict and X-Billed headers. Its MCP server exposes take_screenshot, get_page_info, and capture_pdf to Claude, Cursor, and other MCP clients.
Read the parameter reference in the ScreenshotNeo documentation. A cURL request is:
Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
The equivalent Python call:
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 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}`);
Every plan includes the features: full-page and element capture, device presets or custom viewports, retina scale, PDF controls, custom CSS and JavaScript, waits, request blocking, headers and cookies, geolocation, caching, signed links, asynchronous webhooks, bulk capture, and a usage API. The Free plan includes 1,000 shots per month without a card; paid plans start at $5 for 3,000 shots. Create a free ScreenshotNeo account.
Frequently Asked Questions
Does a higher deviceScaleFactor make a PDF sharper?
Not by itself. It changes emulated device metrics; PDF sharpness and geometry depend on Chromium’s PDF rendering, page dimensions, assets, and PDF options.
Should I use CSS @page or Puppeteer width and height?
Use CSS @page when the document owns its print geometry and set preferCSSPageSize to true. Use width and height when the capture script should enforce a profile independently of page CSS.
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 minuteWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallWhy does a device-sized PDF contain multiple pages?
The chosen page height applies to each PDF page. Content taller than that page, pagination rules, fixed elements, or overflow can create additional pages.
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.

