Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Repair Windows errors before they cause bigger problems3Fix the driver behind crashes, sound loss and screen glitchesSet the PDF page box explicitly instead of relying on a paper preset. In print CSS, use two physical dimensions in @page, with width first and height second:
@page {
size: 8.5in 14in;
margin: 0.5in;
}
The same dimensions can be supplied to Puppeteer or Playwright. Decide whether CSS or the automation API owns the size, then remove conflicting settings and verify the exported PDF in the runtime that will actually run in production.
What “page height” controls
PDF page height is the height of each page box, not the height of the document’s content. The page box is defined by @page { size: ... } or by your PDF library’s paper-size options. Margins reduce the usable content area inside that box; they do not change the page height.
Changing an element’s CSS height only changes that element. It does not, by itself, change the PDF paper size. Use print CSS or the PDF API for the page dimensions, and use @media print for rules that should apply only during export.
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 →#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.
Set a custom height with print CSS
Use width followed by height
The size descriptor accepts absolute dimensions. The first value is width and the second is height, so a tall 8.5-by-14-inch page is:
@page {
size: 8.5in 14in;
margin: 0.5in;
}
Millimetres and centimetres are also valid physical units:
@page {
size: 210mm 350mm;
margin: 12mm 10mm;
}
A single length sets both dimensions. Therefore, size: 6in; creates a square page. For a rectangular page, always provide two lengths, such as the documented custom-size form size: 4in 6in.
Keep screen and print layouts separate
/* Screen styles remain unchanged. */
.report {
max-width: 70rem;
margin: 0 auto;
}
@media print {
.screen-only,
nav,
.chat-widget {
display: none !important;
}
.report {
max-width: none;
margin: 0;
}
}
@page {
size: 8.5in 14in;
margin: 0.5in;
}
Put @page at the top level of the stylesheet, not inside a selector. If your page has backgrounds, remember that the browser’s print dialog may have a separate “background graphics” setting; automation libraries expose their own background option.
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.
Browser print workflow
- Load the page with the print stylesheet available.
- Open the browser’s Print command (usually
Ctrl+PorCmd+P). - Choose “Save as PDF” or the equivalent PDF destination.
- Check the preview for the intended number of pages, margins, and clipping.
- Export, then open the PDF in a viewer to confirm the physical page dimensions.
Support for CSS page sizing varies in older browsers and devices. If your users print from several browser versions, test the actual combinations rather than assuming that a modern implementation behaves identically everywhere.
Choose CSS or the PDF API as the source of truth
Headless browsers generate PDFs using print CSS, but their API options can override the stylesheet. Pick one control surface deliberately:
| Export path | Set height with | Precedence to check |
|---|---|---|
| Browser print dialog | @page { size: width height; } and print settings |
Browser and dialog support; verify the preview |
| Puppeteer | page.pdf({ width, height }) |
format overrides explicit dimensions; CSS wins only when preferCSSPageSize is enabled |
| Playwright | page.pdf({ width, height }) |
preferCSSPageSize decides whether CSS takes priority over API dimensions |
Do not specify a paper format while expecting separate width and height values to win. If CSS is your source of truth, enable the relevant CSS-precedence option and keep the dimensions in @page.
Set height with Puppeteer
Use explicit API dimensions
Puppeteer’s PDFOptions.height accepts a number or a unit-bearing string. Unit-bearing strings make the intent clear:
Windows 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 reinstallOutdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchRank #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.
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto('https://example.com', { waitUntil: 'networkidle0' });
await page.pdf({
path: 'export.pdf',
width: '8.5in',
height: '14in',
margin: {
top: '0.5in',
right: '0.5in',
bottom: '0.5in',
left: '0.5in'
},
printBackground: true
});
await browser.close();
})();
Leave out format when explicit width and height should apply. Puppeteer documents Letter as the default format, so an unnoticed format setting can produce a different paper size than the dimensions you intended.
Let CSS control the paper size
await page.pdf({
path: 'export.pdf',
printBackground: true,
preferCSSPageSize: true
});
With preferCSSPageSize: true, the @page declaration is given priority over API width, height, or format. Puppeteer’s documented default is false, which means the API paper size normally wins and CSS dimensions are scaled to fit.
Control content independently
Use page CSS for the paper box and Puppeteer’s margins for the printable inset, or define margins consistently in CSS and avoid conflicting API values. If text or images are clipped, inspect the content width after margins are applied; increasing page height will not fix horizontal overflow.
Set height with Playwright
Use explicit dimensions
const { chromium } = require('playwright');
(async () => {
const browser = await chromium.launch();
const page = await browser.newPage();
await page.goto('https://example.com', { waitUntil: 'networkidle' });
await page.pdf({
path: 'export.pdf',
width: '8.5in',
height: '14in',
printBackground: true,
preferCSSPageSize: false
});
await browser.close();
})();
Playwright accepts unit-bearing values such as 14in and 350mm. An unlabeled numeric value is interpreted as pixels, so prefer a string with a unit when the requirement is a physical paper height.
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
Give CSS precedence
await page.pdf({
path: 'export.pdf',
printBackground: true,
preferCSSPageSize: true
});
Use this form when the stylesheet contains the authoritative @page size. Otherwise, keep preferCSSPageSize disabled and set width and height in the API. Confirm the exact defaults and supported options for the Playwright version installed in your project, because API behavior can evolve.
Common failure modes and fixes
The PDF is still Letter-sized
- Cause: Puppeteer’s
formatis set, or another wrapper adds a default format. - Fix: Remove
formatwhen using explicit dimensions, or make CSS the source of truth withpreferCSSPageSize: true.
CSS dimensions are ignored in headless export
- Cause: CSS precedence is disabled.
- Fix: Set
preferCSSPageSize: truein Puppeteer or Playwright, and ensure the@pagerule is loaded before callingpdf().
The page is the wrong size by a large amount
- Cause: A unit was omitted. In Playwright, an unlabeled number means pixels.
- Fix: Use values such as
'8.5in','14in','210mm', or'350mm'.
Content is clipped at the bottom
- Cause: The content area is smaller than expected after margins, fixed heights, or print-only rules are applied.
- Fix: Distinguish page height from content height, remove rigid element heights in
@media print, and inspect the result with the intended margins.
Images or backgrounds are missing
- Cause: Resources were not finished loading, or background printing is disabled.
- Fix: Wait for the page’s required resources, then enable
printBackground: truein automation. Check the browser print dialog’s background option for manual exports.
The browser print preview differs from automation
- Cause: The two paths use different settings, browser versions, or CSS support.
- Fix: Test the exact target browser/runtime, record whether CSS or API dimensions own the size, and inspect the generated PDF rather than relying only on screen preview.
Reliability and performance considerations
Wait for the page you intend to export
Navigate to the final URL, wait for the page state appropriate to your application, and make sure fonts, images, and lazy content are present before calling pdf(). A network-idle condition can help for static pages, but applications with long-lived connections may require a selector-based readiness check instead.
Keep one authority for dimensions
Centralize the paper size in CSS or in the export function. Duplicating dimensions in both places makes later changes easy to miss and can produce different output when a precedence option changes.
Validate the artifact
For every deployment target, inspect a generated PDF for physical dimensions, page count, margins, overflow, fonts, and images. Browser support for newer CSS page sizing is not uniform on older devices, so a small compatibility test is more reliable than assuming a successful browser preview covers every client.
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.
Or skip the browser setup
ScreenshotNeo provides a website screenshot API and MCP server for developers. Its PDF capture supports paper size, margins, landscape mode, and page ranges; use the documented PDF parameters for the exact output you need. The API base is https://api.screenshotneo.com/v1/shot.
For a direct request, see the ScreenshotNeo API documentation:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
The same request from Python:
import requests
r = requests.get(
"https://api.screenshotneo.com/v1/shot",
params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"},
timeout=90,
)
r.raise_for_status()
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}`);
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const body = Buffer.from(await res.arrayBuffer());
require('fs').writeFileSync('shot.webp', body);
ScreenshotNeo accepts the consent banner like a visitor, then removes more than 60 known consent platforms along with newsletter popups and chat widgets; each cleanup step can be disabled. Only clean shots are billed. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and each response identifies the result with X-Page-Verdict and X-Billed headers.
It also offers an MCP server for Claude, Cursor, and other MCP clients, with take_screenshot, get_page_info, and capture_pdf tools. Other available options include full-page capture with lazy images loaded, CSS-selector element capture, dark mode, device presets and custom viewports, retina scale, custom CSS and JavaScript, pre-capture clicks, selector waits or delays, network-idle waits, request and resource blocking, custom headers, cookies, user agents, Authorization, timezone and geolocation, transparent backgrounds, resizing, selectable cache TTLs, signed image links, asynchronous jobs with signed webhooks, bulk capture for up to 100 URLs per call, a usage API, and an OpenAPI specification. Parameter names used by other screenshot APIs are accepted to ease migration.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
| Plan | Allowance and price |
|---|---|
| Free | 1,000 shots per month, no card |
| Starter | $5 for 3,000 shots |
| Growth | $15 for 15,000 shots |
| Pro | $39 for 60,000 shots |
| Scale | $99 for 250,000 shots |
| Business | $249 for 1,000,000 shots |
Every feature is included on every plan, and yearly billing provides two months free. Sign up for 1,000 free screenshots a month with no card.
Frequently Asked Questions
Does changing @page height change the web page on screen?
No. The @page rule applies to paged output. Use ordinary screen CSS for the on-screen layout and @media print for print-only changes.
Can one export mix several page heights?
This guide covers a single page size applied to the export. If your document requires different page boxes, verify that the specific browser or PDF engine supports named page rules before designing around them.
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.
Free tools Windows power users keep installed
One-click scans. No signup required.

