New Jun 5, 2026

vue-html2pdf: Line of text is split between pages when generating multi-page PDFs

Libraries, Frameworks, etc. All from Newest questions tagged vue.js - Stack Overflow View vue-html2pdf: Line of text is split between pages when generating multi-page PDFs on stackoverflow.com

I'm using vue-html2pdf v1.8.0 to generate PDF files in a Vue.js application.

I'm encountering a page-break issue when the generated PDF contains multiple pages.

Problem

The last line of text near the bottom of a page is being split horizontally across two pages.

For example:

As a result, the text looks cut in half rather than being moved completely to the next page.

This issue occurs consistently throughout the PDF whenever content reaches a page boundary.

vue-html2pdf configuration

<template>
  <div class="wrapper__detail">
    <TableDetail
      v-for="item in interviews"
      :interview="item"
      :key="item.id"
    />

<div style="display: none"> <vue-html2pdf :show-layout="false" :float-layout="false" :enable-download="true" :preview-modal="false" :pdf-quality="2" :manual-pagination="true" pdf-format="a4" pdf-orientation="portrait" pdf-content-width="800px" :html-to-pdf-options="{ margin: 9, filename: interview_${moment().format('yyyyMMDDHHmmss')}.pdf, html2canvas: { scale: 1, useCORS: true } }" ref="html2PdfRef" > <section slot="pdf-content"> <TableDetail v-for="(item, idx) in interviews" :print="true" :canBreak="idx < interviews.length - 1" :key="item.id" :interview="item" /> </section> </vue-html2pdf> </div> </div> </template>

Child component:

<template>
  <div class="wrapper__table">
    <div
      class="datatable"
      :class="{
        print: print,
        'html2pdf__page-break': print && canBreak
      }"
    >
      ...

<div class="row" v-if="interview && interview.inter_comments" > <div class="col-1">Comment</div> <div class="col-2 break-line"> {{ interview.comments }} </div> </div> </div> </div> </template>

Print CSS:

.print {
  width: 720px;

.col-2 { width: 570px; line-height: 23px; } }

visually, the page break cuts through the middle of the line height, so the top half of the characters appears on page 1 and the bottom half appears on page 2.

Questions

  1. Is this a known issue with vue-html2pdf, html2canvas, or jsPDF?

  2. Is there a way to prevent page breaks from occurring in the middle of a text line?

  3. Are there any recommended CSS settings or library options to ensure that a full line is rendered on one page before breaking to the next?

Any help would be appreciated. Thanks!

Scroll to top