html2pdf.js icon indicating copy to clipboard operation
html2pdf.js copied to clipboard

Getting blank page at bottom & top html2pdf

Open DK-06 opened this issue 2 years ago • 4 comments

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

DK-06 avatar Feb 23 '23 09:02 DK-06

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

qq546002574 avatar Mar 11 '23 13:03 qq546002574

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

Lizh-netizen avatar Sep 02 '23 21:09 Lizh-netizen

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

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

rumunanfeng avatar Nov 10 '23 02:11 rumunanfeng

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

tiagorangel1 avatar Dec 22 '23 12:12 tiagorangel1