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

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

Short answer: CSS rules such as break-before: page, page-break-before: always, and break-inside: avoid target a browser’s print engine. React’s jsPDF.html() path does not print the DOM that way: it renders through html2canvas and jsPDF’s context2d pagination code. Consequently, a rule that works in Chrome’s print preview is not guaranteed to create a boundary in the PDF.

For a dependable forced boundary, construct pages explicitly or render sections separately and place each section at a measured Y position. First record your installed jspdf/html2canvas versions, browser, device, and exact markup; pagination behavior can change between releases.

Why browser page-break CSS does not reliably work in jsPDF.html()

The html() method is a rendering pipeline, not the browser print command. jsPDF documents that its HTML support depends on html2canvas; when you pass an HTML string, the README also identifies DOMPurify as an optional dependency. html2canvas paints the document into a canvas, after which jsPDF’s HTML module converts that result into PDF pages.

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

The inspected HTML-module source routes context2d rendering through html2canvas and assigns pdf.context2d.autoPaging from the autoPaging option. If you omit the option, that source defaults it to true. It does not implement a general pagebreak feature. The source is on the moving master branch, so verify the behavior against the version installed in your application rather than treating the observation as a promise for every release. See the HTML module source documentation.

#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

That explains the common symptom: a heading, card, or table row appears at an unexpected position even though the same element starts on a new printed page in the browser. The canvas renderer measures painted pixels and automatically fills pages; it is not required to honor print-only CSS directives.

Check the implementation before changing CSS

  1. Capture exact versions. Run npm ls jspdf html2canvas (or inspect your lockfile), and record the browser, operating system, viewport, device-pixel ratio, and whether you pass a DOM element or an HTML string.
  2. Confirm the input element. Make sure the element you expect is the one passed to doc.html(). A hidden clone, a stale React ref, or a container with different width can produce a valid but surprising PDF.
  3. Inspect the PDF itself. Do not use browser print preview as proof. Open the generated file, zoom around the intended boundary, and check whether content is clipped, duplicated, or simply flowing to the next automatically generated page.
  4. Reduce the reproduction. Remove external images, web fonts, animations, and complex positioned elements temporarily. Reintroduce them one at a time while keeping the same browser and device.

Use automatic pagination when a natural flow is acceptable

For variable-height reports, start with the renderer’s automatic flow and tune the layout rather than forcing every break with CSS. A minimal React example is:

import { jsPDF } from 'jspdf';

export async function downloadReport() {
  const doc = new jsPDF({ unit: 'pt', format: 'a4' });
  const node = document.getElementById('report');

  await doc.html(node, {
    margin: [36, 36, 36, 36],
    autoPaging: true,
    html2canvas: {
      scale: 2,
      useCORS: true
    },
    callback: (pdf) => pdf.save('report.pdf')
  });
}

autoPaging: true permits jsPDF’s context2d pathway to add pages as rendered content exceeds the available height. It does not mean that page-break-before is interpreted as a hard command. Keep cards and rows internally coherent with layout choices that the canvas can measure: avoid unexplained negative margins, transforms that move pixels outside their layout boxes, and images whose height changes after capture.

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

Reliable ways to force a section onto a new page

Approach 1: Render sections separately

Give each report section its own element, render the first section, add a page, then render the next section. You must know (or measure) the rendered height and choose a Y coordinate that fits the page. The following pattern illustrates the control; adapt dimensions and options to your installed jsPDF version.

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)
import { jsPDF } from 'jspdf';

const renderOptions = {
  margin: 36,
  autoPaging: true,
  html2canvas: { scale: 2, useCORS: true }
};

export async function makePdf() {
  const pdf = new jsPDF({ unit: 'pt', format: 'a4' });
  const first = document.querySelector('#section-one');
  const second = document.querySelector('#section-two');

  await pdf.html(first, {
    ...renderOptions,
    callback: () => {}
  });

  pdf.addPage();
  await pdf.html(second, {
    ...renderOptions,
    x: 36,
    y: 36,
    callback: () => {}
  });

  pdf.save('sections.pdf');
}

Whether the second render starts exactly at y: 36, and whether the first render adds unexpected pages, is version- and content-dependent. If a section can exceed one page, let automatic pagination handle its interior; the explicit addPage() controls only its starting page.

Approach 2: Measure, then place

For a strict one-section-per-page design, measure the element after fonts and images have loaded, compare its height with the usable PDF height, and add pages deliberately. DOM measurements are not identical to canvas measurements, so treat them as a placement estimate and verify the resulting PDF. A spacer based only on an approximate height can fail; one jsPDF issue records an individual report of inaccurate manual height measurement, not a universal defect or solution (issue #3766).

  • Wait for document.fonts.ready and image load completion before measuring.
  • Use the same CSS width, scale, and margins for measurement and capture.
  • Keep a safety margin for rounding and line wrapping.
  • Check the output at the smallest target viewport, because mobile layout changes can alter height.

Approach 3: Split the source markup

If a report has known chapters, create one DOM subtree per chapter rather than one giant element with CSS break markers. This makes page ownership explicit and reduces the chance that a late-loading asset shifts every subsequent boundary. It also simplifies retries: a failed section can be rendered again without rebuilding unrelated pages.

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

Do not confuse jsPDF with html2pdf.js

html2pdf.js is a different wrapper and documents a dedicated html2pdf__page-break class. Its README says the element receives a height calculated to fill the remainder of the PDF page; in React, the project shows the equivalent className="html2pdf__page-break". That documentation is evidence about html2pdf.js, not standalone jsPDF’s html() method.

Rank #3
Sale
Epson Workforce ES-400 II High-Speed Color Duplex Desktop Document Scanner
  • FAST DOCUMENT SCANNING — Document scanner with feeder allows you to speed through stacks with a 50-sheet Auto Document Feeder (ADF); Efficient office scanner to help you scan more productively
  • INTUITIVE, HIGH-SPEED SOFTWARE — Quickly scan with this desktop document scanner; Epson ScanSmart Software lets you easily preview scans, email files, upload to the cloud, and more; Plus, automatic file naming saves even more time
  • SEAMLESS INTEGRATION — Easily incorporate your data into most document management software with the included TWAIN driver; Office document scanner integrates seamlessly with business workflows
  • EASY SHARING — Duplex scanner allows you to scan straight to email or popular cloud storage2 services like Dropbox, Evernote, Google Drive, and OneDrive for simple storage and sharing
  • SIMPLE FILE MANAGEMENT — Scanner allows the creation of searchable PDFs with Optical Character Recognition (OCR) and convert scans to editable Word or Excel files effortlessly; Designed for home and office document scanning

If your project actually calls html2pdf.js, follow that library’s versioned options and test the class in your own markup. If it imports jsPDF directly and calls doc.html(), do not add the class expecting it to work. Changing libraries may require rewriting configuration, loading, callbacks, and output handling, so make the switch only if its API and layout behavior fit your requirements.

Common failure modes and fixes

“page-break-before: always is ignored”

Cause: the rule belongs to browser print pagination, while html2canvas paints a canvas for jsPDF. Fix: stop relying on that declaration for a hard boundary; render the sections separately or add pages and place content explicitly. Keep the rule if the same DOM is also printed by the browser, but verify the PDF independently.

“The break works on desktop but not on a phone”

Cause: viewport width, device-pixel ratio, font availability, and image timing change the rendered dimensions. An August 1, 2025 report describes one user’s mobile transition problem; it is anecdotal and does not establish a general mobile defect (issue #3874). Fix: record the exact device and browser, wait for assets, and reproduce with the same width and markup before selecting page coordinates.

Free tools Windows power users keep installed

One-click scans. No signup required.

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

“A section is clipped or overlaps the footer”

Cause: the measured height, PDF unit conversion, margin, or scale does not match the capture. Fix: reduce scale temporarily, remove transforms, increase margins, and compare the section’s measured height with the page’s usable height. If it can exceed a page, allow automatic pagination instead of forcing it into one.

Rank #4
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

“Images or fonts change the break after deployment”

Cause: cross-origin images may not load, and a fallback font has different metrics. Fix: wait for resources, configure image CORS where appropriate, embed or reliably load the required fonts, and include those assets in the reproduction. Do not claim a particular asset caused the original failure without observing it.

“Passing an HTML string behaves differently”

Cause: string input follows the HTML parsing/sanitization path and may depend on DOMPurify, while an element input uses the live DOM. Fix: test the same input mode used in production, sanitize trustedly, and compare the resulting DOM dimensions before capture.

Performance, reliability, and cost considerations

  • Keep capture areas bounded. Rendering one enormous DOM tree increases canvas memory and makes a small layout change move later pages. Chapter-sized renders are easier to retry.
  • Choose scale deliberately. A higher html2canvas scale can improve text sharpness but increases memory and processing time. Validate on the least capable supported device.
  • Stabilize asynchronous content. Freeze animations, wait for fonts and images, and ensure data has finished loading before calling html().
  • Test page edges. Include short, exactly-full, and over-full sections, long unbroken strings, tables, and missing images in regression fixtures.
  • Log the environment. Store library versions and capture settings with support reports so a PDF can be reproduced rather than guessed at.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If your goal is a clean screenshot of a web page rather than a locally composed React PDF, ScreenshotNeo provides a website screenshot API and MCP server. It accepts consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status.

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

One GET request returns PNG, JPEG, WebP, or PDF. See the ScreenshotNeo documentation for all options.

curl -G "https://api.screenshotneo.com/v1/shot" 
  -d access_key=YOUR_API_KEY 
  --data-urlencode url=https://stripe.com 
  -o shot.webp
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)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

It also offers an MCP server for AI agents such as Claude and Cursor, plus full-page lazy-image loading, CSS-selector element capture, device and viewport controls, PDF page settings, custom CSS and JavaScript, waits, request blocking, headers, cookies, geolocation, signed links, asynchronous jobs, bulk capture, caching, and a usage API. Every feature is on every plan: 1,000 screenshots monthly are free with no card; paid plans start at $5 for 3,000. Create a free ScreenshotNeo account.

Best Value
Sale
ScanSnap iX2500 Wireless or USB High-Speed Document Scanner, Black
  • OUR MOST ADVANCED SCANSNAP. Large touchscreen, fast 45ppm double-sided scanning, 100-sheet document feeder, Wi-Fi and USB connectivity, automatic optimizations, and support for cloud services. Upgraded replacement for the discontinued iX1600
  • CUSTOMIZABLE. SHARABLE. Select personalized profiles from the touchscreen. Send to PC, Mac, mobile devices, and clouds. QUICK MENU lets you quickly scan-drag-drop to your favorite computer apps
  • STABLE WIRELESS OR USB CONNECTION. Built-in Wi-Fi 6 for the fastest and most secure scanning. Connect to smart devices or cloud services without a computer. USB-C connection also available
  • PHOTO AND DOCUMENT ORGANIZATION MADE EFFORTLESS. Easily manage, edit, and use scanned data from documents, receipts, photos, and business cards. Automatically optimize, name, and sort files
  • AVOIDS PAPER JAMS AND DAMAGE. Features a brake roller system to feed paper smoothly, a multi-feed sensor that detects pages stuck together, and skew detection to prevent paper damage and data loss

Decision checklist

  • Need browser print output? Keep print CSS and use the browser’s print/PDF engine.
  • Need jsPDF’s client-side API with natural flow? Use autoPaging, stabilize assets, and verify the PDF.
  • Need a hard chapter boundary? Add pages or render sections separately, with measured placement and version-specific tests.
  • Using html2pdf.js? Its page-break class is a library-specific feature; do not transfer it to standalone jsPDF.

Frequently Asked Questions

Does autoPaging: false make CSS page breaks work?

No. It changes jsPDF’s automatic pagination behavior; it does not turn browser print CSS into a guaranteed page-break API. Use explicit page construction for a forced boundary.

Should I use page-break-after or break-after?

Use them for browser printing when appropriate, but verify independently in jsPDF’s canvas-based HTML renderer. Neither should be promised as a standalone html() control without testing your installed version.

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

Can I fix every report with a fixed spacer div?

No. Variable fonts, images, responsive widths, and device differences make fixed spacers fragile. Measure with the production environment and inspect the generated PDF.

Quick Recap

Bestseller No. 4
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.