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 reinstallShort answer: Puppeteer is not the component deciding where your content splits. page.pdf() switches Chromium to print media, and Chromium’s pagination engine fragments the generated boxes in your layout. break-inside: avoid is only a preference: it works on the box that is actually fragmented, and Chromium can relax it when the box is too tall or the layout makes the requested break impossible.
What page.pdf() is really doing
Puppeteer’s PDF API generates a document with the print CSS media type. That means the layout used for the PDF may differ from what you see in a normal browser tab. An @media print rule can change display, dimensions, overflow, fonts, or visibility before pagination starts.
The PDF is then divided into fragmentainers (normally pages). Chromium’s fragmentation engine decides where each block, table, flex item, grid item, float, and out-of-flow element is split. Puppeteer exposes the API, but it does not implement a separate pagination algorithm or provide a flag that overrides Chromium’s constraints.
Why the rule appears to be ignored
The declaration is on the wrong box
Apply the rule to the block-level wrapper that represents the complete unit you want to keep together. If a card’s outer section is the box that crosses the page boundary, putting break-inside: avoid only on its heading or an inner paragraph does not protect the card.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →#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.
.invoice-item {
break-inside: avoid;
page-break-inside: avoid;
}
Inspect the element that actually spans the boundary in the printed layout. A visually related child may not be the fragmentation candidate.
There is no usable generated box or fragmentation context
MDN defines break-inside as controlling page, column, or region breaks inside a generated box. If the element does not generate the box being fragmented, the declaration has nothing to control. Inline content, unusual wrappers, and elements removed from normal flow can therefore make the rule ineffective.
The protected unit is taller than the printable page
An avoidance request cannot make an arbitrarily tall element fit on one page. If the content is taller than the available page area, Chromium may choose a less desirable break or allow overflow rather than leave an impossible layout. Split a long unit into smaller semantic blocks, or accept a controlled break inside it.
Print CSS overrides the screen rule
Because page.pdf() uses print media by default, inspect every @media print declaration. A print rule may set display, height, overflow, or margins that change the available page height or even replace the element’s layout.
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.
The layout mode has pagination edge cases
Tables, flexbox, grid, floats, transforms, scrolling containers, and absolutely positioned content do not fragment like a simple block in normal flow. Chromium documents separate constraints for these layout modes. A table row or row group may be the real break candidate, while a nested cell or child card is not.
A reliable baseline pattern
Use a real wrapper around one semantic unit and keep it in normal flow while diagnosing the problem.
@media print {
.keep-together {
break-inside: avoid;
page-break-inside: avoid; /* legacy alias */
}
}
<section class="keep-together">
<h2>Invoice item</h2>
<p>All text, metadata, and controls that belong together.</p>
</section>
The legacy page-break-inside declaration is useful for older print behavior, but it does not turn an oversized section into a one-page object. During troubleshooting, remove unnecessary overflow: auto|hidden, transforms, absolute positioning, and nested wrappers that create independent layout boundaries.
Complete Puppeteer example
This script loads the page, waits for network activity to settle, explicitly selects print media, and writes an A4 PDF.
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.
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch();
try {
const page = await browser.newPage();
await page.goto('https://example.com/invoice', {
waitUntil: 'networkidle0'
});
await page.emulateMediaType('print');
await page.pdf({
path: 'invoice.pdf',
format: 'A4',
printBackground: true,
margin: { top: '16mm', right: '16mm', bottom: '16mm', left: '16mm' }
});
} finally {
await browser.close();
}
})();
Use the same CSS on the page being printed. If your production code relies on a fixed paper size, define it explicitly with @page and keep the Puppeteer format and CSS dimensions consistent.
Diagnose the actual printed box
Run this before calling page.pdf(). It returns the computed print styles and the element’s measured height instead of relying on what the screen view appears to show.
await page.emulateMediaType('print');
const metrics = await page.$eval('.keep-together', el => {
const s = getComputedStyle(el);
const r = el.getBoundingClientRect();
return {
display: s.display,
breakInside: s.breakInside,
pageBreakInside: s.pageBreakInside,
overflow: s.overflow,
position: s.position,
width: r.width,
height: r.height
};
});
console.log(metrics);
await page.pdf({ path: 'debug.pdf', printBackground: true });
Also record the Chromium revision or version, paper format, CSS @page size, margins, font readiness, and print-only overrides. Each changes the fragmentainer height or the break candidates. If the same split occurs when you print the page from Chrome’s own UI or command line, changing Puppeteer options alone is unlikely to fix it; the behavior is in Chromium’s pagination path.
Tables, flexbox, grid, and floats
Tables
For a table, test the row, row group, and table wrapper separately. A row may be fragmented even when a child cell has break-inside: avoid. Keep borders and repeated headers in mind: pagination can expose uneven borders when a row or nested block is split. If one record must remain intact, consider rendering each record as a block-level section in print CSS rather than depending on a complex table layout.
Free tools Windows power users keep installed
One-click scans. No signup required.
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
Flex and grid
Flex and grid containers have their own fragmentation constraints. If pagination remains unstable, add a print-only rule that changes the component to ordinary block flow:
@media print {
.card-grid,
.card-grid > * {
display: block;
}
.card {
break-inside: avoid;
page-break-inside: avoid;
}
}
Use this only for the printed version; changing the screen layout unnecessarily can introduce new responsive problems.
Overflow, transforms, and out-of-flow elements
Scrolling boxes, clipped overflow, transforms, fixed positioning, and absolute positioning can create boundaries that do not paginate like normal blocks. Temporarily remove those properties, confirm that the block-flow version paginates correctly, then reintroduce only the declarations you actually need.
When to force a page break
Use break-before: page or break-after: page when a section must start on a new page, such as a report chapter or an appendix.
Recommended Free Tools
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.
.chapter {
break-before: page;
}
Do not add forced breaks to every card. They create blank space and conceal the real sizing or layout problem. Treat break-inside: avoid as a preference for a semantic unit, and reserve forced breaks for intentional section boundaries.
Troubleshooting checklist
| Symptom | Likely cause | Fix |
|---|---|---|
| The heading stays with the card, but the card body splits | The rule is on a child instead of the fragmented wrapper | Move both break declarations to the block that contains the complete card |
| The rule works on screen but not in the PDF | Print media changes the computed layout | Inspect @media print rules after calling emulateMediaType('print') |
| A very long section always breaks | It is taller than the printable page | Split it into smaller units or permit a controlled internal break |
| Only tables split unexpectedly | The table row, row group, or cell is the actual break candidate | Test the table structure; use print-only block flow for complex records |
| Flex or grid cards paginate inconsistently | Layout-specific fragmentation constraints | Try a print-only block layout and keep the avoid rule on each card wrapper |
| Changing Puppeteer flags has no effect | The Chromium revision itself is making the same decision | Print through Chrome directly, capture the browser version, and validate against the exact production revision |
| Different machines produce different page boundaries | Paper size, margins, fonts, or browser revisions differ | Pin the browser revision, load fonts before PDF generation, and set paper and margins explicitly |
Performance, reliability, and maintenance
- Wait for the content that determines height: network idle alone does not guarantee that web fonts, client-side rendering, or lazy images have finished.
- Keep the PDF’s paper format, margins, and
@pagerules under version control so a CSS change does not silently reduce the printable area. - Prefer semantic wrappers over styling individual descendants; the wrapper remains the unit you can test when the DOM changes.
- Test representative short, exactly-one-page, and multi-page units. A rule that works for a short card can still fail when the same component contains long text.
- Recheck pagination after Chromium upgrades. Fragmentation behavior is version-sensitive, and no workaround is universal for every DOM structure.
Or skip the browser setup
If your goal is a clean image or PDF of a URL rather than control over a local Puppeteer layout, ScreenshotNeo provides a single request API and an MCP server for AI agents. Before capture it accepts cookie or consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be disabled. Bot checks, CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and the response identifies the page verdict and billing result in X-Page-Verdict and X-Billed headers.
Use the API documentation at https://screenshotneo.com/docs/ for all options, including full-page capture, element selectors, device and retina settings, PDF paper and margin controls, custom CSS and JavaScript, waits, request blocking, cookies and headers, geolocation, signed links, asynchronous jobs, bulk capture, caching TTLs, and usage reporting.
cURL
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com/invoice -o invoice.webp
Python
import requests
r = requests.get(
"https://api.screenshotneo.com/v1/shot",
params={"access_key": "YOUR_API_KEY", "url": "https://example.com/invoice"},
timeout=90,
)
r.raise_for_status()
open("invoice.webp", "wb").write(r.content)
Node.js
const q = new URLSearchParams({
access_key: 'YOUR_API_KEY',
url: 'https://example.com/invoice'
});
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const data = Buffer.from(await res.arrayBuffer());
require('fs').writeFileSync('invoice.webp', data);
ScreenshotNeo includes an MCP server with take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots, and every feature is available on every plan. Create a free ScreenshotNeo account to try it.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Fix the driver behind crashes, sound loss and screen glitches3Clear out junk files and repair common Windows errorsFAQ
Frequently Asked Questions
Does break-inside: avoid affect ordinary screen scrolling?
Not by itself. It matters when the browser creates a fragmentation context, such as printed pages, columns, or regions; a normal, unpaginated screen does not have page boundaries to honor.
Can two valid CSS layouts produce different PDFs?
Yes. Different Chromium revisions, loaded fonts, paper dimensions, margins, and print-media rules can change the available fragmentainer height and therefore the chosen break.
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.

