vue-html2pdf icon indicating copy to clipboard operation
vue-html2pdf copied to clipboard

Use html2pdf__page-break only if necessary

Open JacquesJahnichen opened this issue 2 years ago • 2 comments

First of all thanks for this plugin.

How can I add a break (html2pdf__page-break for example) only if an element is cut ? The size of my document is variable. Exemple :

image

JacquesJahnichen avatar Jul 27 '22 12:07 JacquesJahnichen

A little reminder on this subject

JacquesViviarto avatar Aug 09 '22 09:08 JacquesViviarto

If anyone has an idea to solve this problem, I welcome it.

JacquesViviarto avatar Aug 22 '22 06:08 JacquesViviarto

One way to solve this is to use section

  <section class="pdf-item">
    <OrderDiscount />
  </section>
  <section class="pdf-item">
    <OrderConditionPrice />
  </section>
.pdf-item {
  page-break-inside: avoid;
}

You can also find options in : https://ekoopmans.github.io/html2pdf.js/#page-breaks

JacquesJahnichen avatar Nov 15 '22 16:11 JacquesJahnichen