eKoopmans / html2pdf.js

Client-side HTML-to-PDF rendering using pure JS.
MIT License
4.16k stars 1.39k forks source link

Getting blank page at bottom & top html2pdf #631

Open DK-06 opened 1 year ago

DK-06 commented 1 year ago

I have an application, i will convert xml to pdf. Using latest version of html2pdf & html2canvas. Most solution is when u add page-break: 'avoid-all'. I have tried page-break & tried all options in page-break: avoid-all, css, legacy but all the options i'm getting issues which is the content is not fit in the page means it adding empty page at bottom.

Please provide a solution for this issue

qq546002574 commented 1 year ago

A4的高度设置成1123px或者把height设置成max-height,The height of A4 is set to 1123px((height = context + padding + margin),or set max-height.

Lizh-netizen commented 1 year ago

may i ask how did you solve the problem? thank you

rumunanfeng commented 1 year ago

A4的高度设置成1123px或者把height设置成max-height,The height of A4 is set to 1123px((height = context + padding + margin),or set max-height.

请问这个高度要在哪里设置?

tiagorangel1 commented 11 months ago

I even tried checking if the problem was that my image was oversized, but nope. Even with transform: scale(0.8) and the image CLEARLY not occupying more than 1 page it kept adding an extra page