Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
World desk6 min

How to Convert a Responsive Webpage to PDF at Mobile Width

Learn how to set a responsive mobile viewport and export a webpage as a PDF without confusing viewport width with PDF page size.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To make a PDF that reflects a webpage’s mobile layout, set the browser’s responsive viewport to the target width before loading the page, then generate the PDF with deliberate screen-versus-print and paper-size settings. A mobile viewport triggers responsive CSS; it does not automatically make the PDF page narrow. If you need a pixel-faithful visual record rather than a paginated document, capture a screenshot instead.

First choose what “mobile-width PDF” means

There are two separate dimensions to control:

  • Viewport width: the browser’s CSS-pixel width. This determines which responsive layout rules the page uses.
  • PDF page size: the physical width and height of the exported pages. These determine how content is laid out or paginated in the document.

Setting a narrow viewport can trigger the site’s phone layout, but print styles or standard paper dimensions may still change that layout in the PDF. For a record of rendered pixels, use a screenshot. For a document that can flow across pages, use PDF printing and inspect the result.

As an Amazon Associate I earn from qualifying purchases.

What you need Use Decide
A visual record of the page at mobile width Responsive viewport plus screenshot Capture the visible area or the full scrollable page.
A paginated PDF Responsive viewport plus browser PDF printing Choose screen or print styling, paper dimensions, margins, scale and background handling.
Repeatable scripted output Playwright or Chrome headless Set the viewport before navigation and configure PDF output explicitly.

Use Chrome DevTools for a one-off capture

  1. Open the page in Chrome and open DevTools.
  2. Toggle the device toolbar, then use Responsive mode to enter the target width and height or select a device dimension. Choose a CSS-pixel width that represents the layout you want.
  3. Navigate to the page or reload it with that viewport active, so its responsive styles can apply.
  4. For an image rather than a PDF, use DevTools’ screenshot options to capture the visible viewport or the full page.
  5. For a PDF, use the browser’s print workflow and review the print preview. Check whether print styling changed the layout and whether the page dimensions give you the narrow output you intended.

Chrome Device Mode simulates a mobile environment; it is not a real phone and cannot reproduce every mobile-specific behavior. Use an actual device to validate behavior that depends on phone hardware or software. See Google’s Device Mode documentation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Automate PDF generation with Playwright

Set the viewport before navigation, then choose the media type and PDF page options. Playwright’s page.pdf() uses print CSS by default. If you want the screen-rendered styling, emulate screen media before generating the PDF. Numeric PDF dimensions without units are interpreted as pixels; explicit units such as px, in, cm and mm are also accepted.

#1 Best Overall
Sale
Epson Workforce ES-50 Compact & Lightweight Mobile Document Scanner
  • PORTABLE SCANNER FOR USE ON-THE-GO — The fastest and lightest mobile single-sheet-fed compact document scanner in its class¹
  • QUICK DOCUMENT SCANNING ― This Epson ultra-fast scanner scans a single page as quickly as 5.5 seconds²; Windows and Mac compatible
  • VERSATILE PAPER HANDLING ― Portable scanner scans documents up to 8.5 x 72 in; Also easily digitizes receipts and ID cards to make accounting, bookkeeping, and organizing simpler
  • INTUITIVE, HIGH-SPEED SOFTWARE — Epson ScanSmart Software³ is a smart tool allowing you to easily scan, review, and save; Stay organized easily with the help of this Epson scanner
  • EASY SETUP — USB-powered connect to your computer for quick and simple scanning; No batteries or external power supply required to operate portable document scanner; Standard Connectivity: USB 2.0
import { chromium } from 'playwright';

const targetUrl = 'https://example.com';
const mobileWidth = 390;
const mobileHeight = 844;

const browser = await chromium.launch();
const page = await browser.newPage({
  viewport: { width: mobileWidth, height: mobileHeight }
});

await page.goto(targetUrl, { waitUntil: 'networkidle' });
// Use screen CSS rather than Playwright's default print CSS.
await page.emulateMedia({ media: 'screen' });

await page.pdf({
  path: 'mobile-width.pdf',
  width: `${mobileWidth}px`,
  height: '1100px',
  margin: { top: '0', right: '0', bottom: '0', left: '0' },
  printBackground: true,
  preferCSSPageSize: false
});

await browser.close();

Replace the example URL and dimensions with your target. The width in the PDF options controls the output page width; it is separate from the viewport width. Set the height and margins to suit the document you need. If you want print styling, omit the screen-media emulation. If the page defines its own CSS page size and you want to honor it, consider preferCSSPageSize; otherwise configure the output dimensions yourself. Playwright’s Page API reference documents viewport sizing, media emulation and PDF options.

Use Chrome headless from the command line

Chrome headless can print a loaded page to PDF:

chrome --headless --print-to-pdf=output.pdf https://example.com

This command prints the page, but by itself it does not specify a mobile viewport. For a mobile-responsive PDF, use browser automation that sets the viewport before navigation, or use the Chrome DevTools Protocol and configure the emulated device metrics as well as PDF output. The Protocol’s Page.printToPDF method includes paper width and height, margins, orientation, scale, and header/footer controls. See the Chrome Headless command-line reference and the Chrome DevTools Protocol Page documentation.

Rank #2
Sale
Brother DS-640 Compact Mobile Document Scanner, (Model: DS640)
  • FAST SPEEDS - Scans color and black and white documents a blazing speed up to 16ppm (1). Color scanning won’t slow you down as the color scan speed is the same as the black and white scan speed.
  • ULTRA COMPACT – At less than 1 foot in length and only about 1. 5lbs in weight you can fit this device virtually anywhere (a bag, a purse, even a pocket).
  • READY WHENEVER YOU ARE – The DS-640 mobile scanner is powered via an included micro USB 3. 0 cable allowing you to use it even where there is no outlet available. Plug it into you PC or laptop and you are ready to scan.
  • WORKS YOUR WAY – Use the Brother free iPrint&Scan desktop app for scanning to multiple “Scan-to” destinations like PC, Network, cloud services, Email and OCR. (2) Supports Windows, Mac and Linux and TWAIN/WIA for PC/ICA for Mac/SANE drivers. (3)
  • OPTIMIZE IMAGES AND TEXT – Automatic color detection/adjustment, image rotation (PC only), bleed through prevention/background removal, text enhancement, color drop to enhance scans. Software suite includes document management and OCR software. (4)

The headless command-line reference also documents --timeout to allow time for page content to load and --no-pdf-header-footer to omit generated headers and footers. Flag availability can vary by Chrome version; if Chrome rejects a flag, check the documentation for the installed version.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Make dynamic pages ready before capture

Content loaded after the initial navigation—such as lazy images or client-rendered sections—may not be ready when capture begins. In Playwright, wait for a meaningful page-specific condition when possible, such as a selector that appears when the needed content is ready. A fixed delay is an option when the page offers no readiness signal, but there is no universal delay that works for every site. Chrome headless also provides a timeout option for loading content.

Rank #3
Sale
Canon imageFORMULA R10 - Portable Document Scanner, USB Powered, Duplex Scanning, Document Feeder, Easy Setup, Convenient, Perfect for Mobile Users, White
  • STAY ORGANIZED – Easily convert your paper documents into digital formats like searchable PDF files, JPEGs, and more.Power Consumption : 2.5W or less (Energy Saving Mode: 0.7W). Suggested Daily Volume : 500 scans..Does it contain liquid: no
  • CONVENIENT AND PORTABLE –lightweight and small in size, you can take the scanner anywhere from home offices, classrooms, remote offices, and anywhere in between
  • HANDLES VARIOUS MEDIA TYPES – Digitize receipts, business cards, plastic or embossed cards, reports, legal documents, and more
  • FAST AND EFFICIENT – No technical hurdles or complicated setups here; easily scan both sides of a document at the same time, in color or black-and-white, at up to 12 pages-per-minute, and with a 20 sheet automatic feeder
  • BROAD COMPATIBILITY – Works with both Windows and Mac devices, be it laptop or computer

Check the PDF before relying on it

  • Verify that the responsive layout corresponds to the intended viewport width.
  • Check whether print CSS has hidden, rearranged or restyled screen content.
  • Confirm the PDF page width, page breaks and margins; narrow viewport settings alone do not set the paper dimensions.
  • Look for clipped content, missing backgrounds and unwanted headers or footers.
  • If the page’s behavior matters on an actual phone, test it on that device rather than relying solely on desktop emulation.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshooting

The PDF looks like a desktop page

Set the mobile viewport before navigating, not after the page has already laid itself out. In a script, create the page or context with the target viewport before goto(). Check that the chosen width is in CSS pixels and that the page has reloaded at that size.

The PDF switches to a different design

Playwright defaults to print media for PDF generation. Call page.emulateMedia({ media: 'screen' }) before page.pdf() when you need screen CSS. If print styling is intended, keep print media and inspect the page’s print rules.

Rank #4
IRIScan Express 4 Black Compact Portable USB Simplex Document Scanner, 8 PPM for Contracts, Invoices and Business Cards, Compatible with Windows, Readiris PDF Included
  • IRIScan Express, portable scanner : scans color and black and white documents a blazing speed up to 8ppm simplex. Color scanning won’t slow you down as the color scan speed is the same as the black and white scan speed.
  • IRIScan Express mobile scanner is powered via an included micro USB 2. 0 cable allowing you to use it even where there is no outlet available. Plug it into you PC or laptop and you are ready to scan. USB cable provided. AC Adapter not provided and not needed.
  • IRIScan flatbed scanner uses a simplex scanning mode allows for quick and straightforward scanning of single-sided documents. IRIScan with its full portable features is the ideal document scanners for computers.
  • IRIScan document scanner : Versatile scanning capabilities, including scanning to Word, PDF, and Excel formats with companion software provided Readiris OCR
  • Receipt scanner and card scanner with Additional features include scanning business cards directly to Outlook, photo scanning, and receipt scanning for efficient document management

The PDF is still letter- or A4-shaped

Viewport width and PDF paper width are independent. Set the PDF width and, where needed, height explicitly, and account for margins and scale. Chrome’s PDF protocol exposes paper dimensions and other print controls.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Images or sections are missing

Wait for the specific content the capture needs before exporting. For lazy-loaded content, scroll or otherwise trigger it as appropriate, then wait for the relevant elements to appear. Avoid treating a single fixed delay as reliable for every site.

Best Value
Canon Canoscan Lide 300 Scanner (PDF, AUTOSCAN, Copy, Send)
  • Scanner type: Document
  • Connectivity technology: USB
  • With Auto Scan Mode, the scanner automatically detects what you're scanning
  • Digitize documents and images

Chrome rejects a command-line flag

Check the installed Chrome version’s headless documentation; command-line flag availability can change. Use the documented flags for that version or automate PDF settings through the DevTools Protocol.

Or skip the browser setup

ScreenshotNeo can return a webpage capture or PDF from one GET request. Its API supports viewport and PDF controls; cookie banners, newsletter popups and chat widgets are removed before the shot, and each of those steps can be turned off. Bot checks, blank pages, timeouts, failed loads and cache hits are not billed, with the page verdict and billing status reported in response headers. ScreenshotNeo also has an MCP server for AI agents, with tools including take_screenshot, get_page_info and capture_pdf. The free plan includes 1,000 shots per month without a card; paid plans start at $5 for 3,000 shots. See the API documentation for request options.

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

For mobile-width PDF output, configure the API’s viewport and PDF options as described in the documentation. Sign up for 1,000 free screenshots a month, with no card required.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Quick Recap

SaleBestseller No. 3
Canon imageFORMULA R10 - Portable Document Scanner, USB Powered, Duplex Scanning, Document Feeder, Easy Setup, Convenient, Perfect for Mobile Users, White
Canon imageFORMULA R10 - Portable Document Scanner, USB Powered, Duplex Scanning, Document Feeder, Easy Setup, Convenient, Perfect for Mobile Users, White
BROAD COMPATIBILITY – Works with both Windows and Mac devices, be it laptop or computer; This product is not intended for scanning photographs on photo paper / photographic media
$153.00
Bestseller No. 4
IRIScan Express 4 Black Compact Portable USB Simplex Document Scanner, 8 PPM for Contracts, Invoices and Business Cards, Compatible with Windows, Readiris PDF Included
IRIScan Express 4 Black Compact Portable USB Simplex Document Scanner, 8 PPM for Contracts, Invoices and Business Cards, Compatible with Windows, Readiris PDF Included
Find our Software here : irislink.com/start; IRIScan Express is only compatible Windows platform and not macintosh
$129.00
Bestseller No. 5
Canon Canoscan Lide 300 Scanner (PDF, AUTOSCAN, Copy, Send)
Canon Canoscan Lide 300 Scanner (PDF, AUTOSCAN, Copy, Send)
Scanner type: Document; Connectivity technology: USB; With Auto Scan Mode, the scanner automatically detects what you're scanning
$75.00

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.