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

Start by checking the exact wkhtmltopdf binary and whether it uses patched Qt, then reproduce the problem in a small HTML file and inspect the resulting PDF. For ordinary blocks, page-break-inside: avoid can help keep content together, but it is not a universal fix. Table rows and CSS multi-column layouts need separate testing: the available documentation and issue reports do not establish dependable behavior for every build.

Why page breaks behave unpredictably

wkhtmltopdf uses WebKit to lay out content as one long page and then cuts that layout into pages. The Debian Bookworm manual explains that this can split lines and images at page boundaries. It describes CSS page-break-inside as a partial remedy when using a patched Qt build—not a guarantee that every element will stay intact. The manual identifies its packaged version as wkhtmltopdf 0.12.6-2+b1 and was last updated 2022-09-19. Debian Bookworm wkhtmltopdf manual.

That distinction matters: a rule that helps a short section may not keep a tall element, a large table, or a CSS column fragment together. Before changing CSS, confirm that the binary running locally is the same one used in production. A GUI wrapper, container, server package, or deployment image can invoke a different build.

Identify the wkhtmltopdf and Qt build

Run the following command in the same environment that generates the PDF:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
PDF Converter Ultimate - Convert PDF files into Word, Excel, PowerPoint and others - PDF converter software with OCR recognition compatible with Windows 11 / 10 / 8.1 / 8 / 7
  • Convert your PDF files into Word, Excel & Co. the easy way
  • Convert scanned documents thanks to our new 2022 OCR technology
  • Adjustable conversion settings
  • No subscription! Lifetime license!
  • Compatible with Windows 11, 10, 8.1, 7 - Internet connection required
wkhtmltopdf --version

Record the full output with your bug report and deployment details. Establish whether the build uses patched Qt; the manual’s page-break guidance is explicitly conditional on that. A version string alone may not tell you everything about how your packaged or custom binary was built, so check the package or build information available in your environment.

Keep a short record of the command, input HTML, options, and output PDF for each test. This helps distinguish a CSS change from a change in page size, margins, binary, or smart-shrinking behavior.

Reproduce the failure with a minimal document

Make a small HTML file that contains only the element that breaks incorrectly and the styles that affect it. Retain relevant fonts, table structure, column container, page settings, and any scripts needed to reproduce the result. Remove unrelated styles and scripts, then render using the exact binary and options used in production. This is a practical isolation technique, not a documented universal repair; it makes build-specific behavior easier to observe.

When comparing output, change one variable at a time and inspect the actual PDF at its target paper size. Check page boundaries, clipped content, row borders, repeated headers, and whether a supposedly unbroken block fits in the remaining page area.

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

Keep bounded blocks together

Try page-break-inside: avoid on a section, card, or modest group of content that can physically fit on one page:

Rank #2
Doxillion Free Document Converter – Converts DOCX, DOC, PDF, WPS and Many More Files Quickly [Download]
  • Convert over 50 document file formats.
  • Preview your files from Doxillion before converting them.
  • Use batch conversion to convert thousands of files at once.
  • Enjoy an easy-to-use, intuitive interface with a Drag and Drop file option.
  • Burn your converted or original files directly to disc.
.keep-together {
  page-break-inside: avoid;
}

<section class="keep-together">
  <h2>Summary</h2>
  <p>A short block intended to remain on one page.</p>
</section>

Apply the rule narrowly and test it with your installed build. A block taller than the printable area cannot be kept intact on one page; a long table may also need a different structure. The wkhtmltopdf manual calls the property a way to remedy splitting “somewhat” on patched Qt, so treat the output PDF—not the CSS declaration—as the evidence that it worked. Read the manual’s page-breaking discussion.

Force a new page at a deliberate boundary

When a section should start on a fresh page, test an explicit page break on its wrapper rather than assuming row-level instructions will be honored:

.new-page {
  page-break-before: always;
}

<section class="new-page">
  <h2>Appendix</h2>
  <p>This section is intended to start on a new page.</p>
</section>

Render the PDF and verify the break. A report for a wkhtmltopdf 0.12.3-dev build says break-before and break-after directives on table rows were ignored. That is a version-specific user report, not proof of behavior in all builds. Issue report concerning page breaks on table rows.

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

Handle large tables and row splits

Tables are a common source of awkward pagination because the desired unit—a row, cell, header, or group of rows—may not correspond to how a particular build fragments the rendered page. One report from a user testing wkhtmltopdf 0.12.2.4 with patched Qt describes different results for rules on td versus tr, along with border and header artifacts when trying to avoid row breaks. Treat that report as an example of build- and document-specific behavior, not a universal rule. Issue report about page-break-inside behavior.

  • Test the rule on the actual table structure and exact build; do not infer that a rule on a cell behaves like one on a row.
  • If rows split or borders overlap, try dividing one very long table into shorter tables at sensible semantic boundaries.
  • Where a row is too tall to fit on a page, restructure its content into smaller rows or blocks rather than expecting an avoid rule to keep it intact.
  • Check headers and borders on every affected page, not just the first break.

These are workarounds to evaluate against your document. The cited issue records user observations for its tested build and structure; it does not establish a single CSS recipe for all wkhtmltopdf releases.

Rank #3
PDF Extra 2024| Complete PDF Reader and Editor | Create, Edit, Convert, Combine, Comment, Fill & Sign PDFs | Lifetime License | 1 Windows PC | 1 User [PC Online code]
  • EDIT text, images & designs in PDF documents. ORGANIZE PDFs. Convert PDFs to Word, Excel & ePub.
  • READ and Comment PDFs – Intuitive reading modes & document commenting and mark up.
  • CREATE, COMBINE, SCAN and COMPRESS PDFs
  • FILL forms & Digitally Sign PDFs. PROTECT and Encrypt PDFs
  • LIFETIME License for 1 Windows PC or Laptop. 5GB MobiDrive Cloud Storage Included.

Test CSS multi-column layouts separately

A multi-column container is not the same pagination problem as a normal block or table. The available sources do not establish reliable support for CSS multi-column pagination or column-break properties across wkhtmltopdf builds. Do not assume that columns, column-break-*, or modern break-* rules will behave consistently just because a browser preview looks correct.

  1. Create a minimal page with the same column count, content length, fonts, page settings, and relevant CSS as the failing document.
  2. Render it with the installed production binary, then inspect how content flows between columns and across pages.
  3. If column fragmentation remains unpredictable, test a simpler print layout, such as separate column containers or a single-column version.
  4. Validate the workaround in the generated PDF at the required paper size before adopting it.

Separate containers and a single-column print layout are alternatives to test, not guaranteed fixes. The important check is the PDF produced by the target binary.

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

Check smart shrinking when scale or fit changes

wkhtmltopdf’s usage documentation lists --disable-smart-shrinking. The documentation describes the default intelligent shrinking behavior as changing the pixel/DPI ratio; the option disables that behavior. If content size or fit is implicated in a pagination issue, compare runs with and without the flag while holding paper size and margins constant. It is a scale variable to investigate, not a universal page-break fix. wkhtmltopdf usage documentation.

wkhtmltopdf --disable-smart-shrinking input.html output.pdf

Compare that PDF with one rendered without the option. If you also change margins, page size, CSS, or the binary, you will not know which change affected the result.

A practical diagnosis matrix

What you see What to check Next test
A short section splits between pages Whether the build uses patched Qt and whether the block fits in the printable area Try page-break-inside: avoid on that bounded section and inspect the PDF
A table row splits, or borders and headers look wrong Whether the rule is attached to a cell, row, or larger group; the specific build and table structure Test the exact table, then try shorter tables or smaller semantic rows
A section does not start on a new page Whether the break rule is on a wrapper or a table row Test page-break-before: always on a section wrapper
Text fits differently or scale shifts Page size, margins, and smart-shrinking setting Compare with and without --disable-smart-shrinking, changing nothing else
Content flows unpredictably through columns Actual binary and the minimal CSS multicolumn reproduction Test separate containers or a single-column print layout in the generated PDF

Troubleshooting common failures

The CSS rule has no visible effect

First verify that the HTML being rendered contains the rule and that you tested the production binary, not a different local installation. If the build is not patched Qt, the manual’s partial page-break guidance may not apply. Reduce the example and test a modest block that fits on one page.

Rank #4
MobiPDF Lifetime - Professional PDF Editor for Windows | Edit, Sign & Convert PDFs | Best Adobe Acrobat Pro Alternative | Lifetime License
  • Edit PDFs with Ease. Modify text, images, and layouts directly within your PDF documents.
  • Convert & Organize. Export PDFs to Word, Excel, or ePub, and organize files with ease.
  • Read & Annotate. Enjoy intuitive reading modes and powerful tools to comment, highlight, and mark up PDFs.
  • Create & Manage PDFs. Create new PDFs, combine multiple files, scan documents, and compress for easy sharing.
  • Fill & Sign Forms. Complete forms and digitally sign documents with secure e-signature tools.

A row-level break is ignored

Do not assume table rows handle break directives like section wrappers. Move the test to a bounded wrapper where appropriate, then inspect the result. The reported 0.12.3-dev behavior for table rows illustrates why the target build must be checked. See the row-break issue report.

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

Applying avoid creates border or header artifacts

Test the rule on the relevant cell, row, or group and compare the PDF across the affected pages. If the table remains fragile, split it at meaningful boundaries or restructure its rows; the 0.12.2.4 patched-Qt report documents one user’s differing results and cosmetic artifacts, not a universal outcome. See the page-break-inside report.

The page fits only after shrinking

Keep page size and margins fixed and compare output with and without --disable-smart-shrinking. Because the option changes the shrinking behavior, it can affect scale and fit; do not treat it as proof that pagination itself has been corrected. Check the option in the usage documentation.

The PDF differs from the browser preview

The PDF is the result that matters. Reproduce it with the deployment binary and options, preserve the relevant fonts and page settings, and inspect the page boundaries directly. A browser preview alone does not establish how wkhtmltopdf will fragment the content.

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 capture of a web page rather than control over wkhtmltopdf’s PDF pagination, ScreenshotNeo provides a one-request screenshot API. It is not a wkhtmltopdf CSS fix: it returns a screenshot or PDF from a URL, so use it when that output suits the job.

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.
Best Value
PDF Pro 3 - PDF editor to create, edit, convert and merge PDFs - 100% Compatible with Adobe Acrobat - for Windows 11, 10, 8.1, 7
  • ALL-IN-ONE SOLUTION – read, edit, convert, merge and protect your PDF files
  • MAXIMUM FUNCIONALITY – create interactive forms, compare PDFs, bates numbering, find and replace text or colors, convert documents, OCR engine, comment, highlight, fill out and print forms, document protection and others
  • EASY TO INSTALL AND USE – well-structured user-interface, in-program instructions, free tech support whenever you need it
  • GREAT VALUE FOR MONEY - why spend a fortune if you can have maximum functionality at a reasonable price - this also fits the requirements of companies very well

cURL example, adapted to the target URL:

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

See the ScreenshotNeo API documentation for request options. Cookie and consent banners are accepted and removed before capture, along with known newsletter popups and chat widgets; those steps can each be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, with response headers indicating the page verdict and billing status. An MCP server exposes take_screenshot, get_page_info, and capture_pdf for AI agents using Claude, Cursor, or another MCP client.

The free plan includes 1,000 shots per month without a card; paid plans start at $5 for 3,000 shots. Learn about ScreenshotNeo or sign up for 1,000 free screenshots a month with no card.

Sources and scope

The pagination explanation and patched-Qt qualification come from the Debian Bookworm wkhtmltopdf manual. The smart-shrinking behavior comes from the project’s usage documentation. The two GitHub issues cited above are user reports tied to particular versions and document structures; they are useful examples, not cross-version guarantees. The sources cited here do not settle CSS multi-column pagination behavior for every build, so validate that layout with the binary you intend to use.

Frequently Asked Questions

Does page-break-inside: avoid guarantee that content will stay on one page?

No. The wkhtmltopdf manual describes it as a partial aid with patched Qt, and content taller than the available page cannot fit intact.

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

Can I rely on CSS columns to paginate correctly in wkhtmltopdf?

The cited sources do not establish reliable multi-column pagination across builds. Test a minimal example using your target binary and inspect the generated PDF.

Does --disable-smart-shrinking fix page breaks?

No. It changes the smart-shrinking behavior and is worth testing when scale or fit is involved, but it is not documented as a universal pagination fix.

Quick Recap

Bestseller No. 1
PDF Converter Ultimate - Convert PDF files into Word, Excel, PowerPoint and others - PDF converter software with OCR recognition compatible with Windows 11 / 10 / 8.1 / 8 / 7
PDF Converter Ultimate - Convert PDF files into Word, Excel, PowerPoint and others - PDF converter software with OCR recognition compatible with Windows 11 / 10 / 8.1 / 8 / 7
Convert your PDF files into Word, Excel & Co. the easy way; Convert scanned documents thanks to our new 2022 OCR technology
$29.99
Bestseller No. 2
Doxillion Free Document Converter – Converts DOCX, DOC, PDF, WPS and Many More Files Quickly [Download]
Doxillion Free Document Converter – Converts DOCX, DOC, PDF, WPS and Many More Files Quickly [Download]
Convert over 50 document file formats.; Preview your files from Doxillion before converting them.
Bestseller No. 3
PDF Extra 2024| Complete PDF Reader and Editor | Create, Edit, Convert, Combine, Comment, Fill & Sign PDFs | Lifetime License | 1 Windows PC | 1 User [PC Online code]
PDF Extra 2024| Complete PDF Reader and Editor | Create, Edit, Convert, Combine, Comment, Fill & Sign PDFs | Lifetime License | 1 Windows PC | 1 User [PC Online code]
READ and Comment PDFs – Intuitive reading modes & document commenting and mark up.; CREATE, COMBINE, SCAN and COMPRESS PDFs
$99.99
Bestseller No. 4
MobiPDF Lifetime - Professional PDF Editor for Windows | Edit, Sign & Convert PDFs | Best Adobe Acrobat Pro Alternative | Lifetime License
MobiPDF Lifetime - Professional PDF Editor for Windows | Edit, Sign & Convert PDFs | Best Adobe Acrobat Pro Alternative | Lifetime License
Edit PDFs with Ease. Modify text, images, and layouts directly within your PDF documents.; Convert & Organize. Export PDFs to Word, Excel, or ePub, and organize files with ease.
$99.99
Bestseller No. 5
PDF Pro 3 - PDF editor to create, edit, convert and merge PDFs - 100% Compatible with Adobe Acrobat - for Windows 11, 10, 8.1, 7
PDF Pro 3 - PDF editor to create, edit, convert and merge PDFs - 100% Compatible with Adobe Acrobat - for Windows 11, 10, 8.1, 7
ALL-IN-ONE SOLUTION – read, edit, convert, merge and protect your PDF files
$29.99

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.