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

adding support to split the pdf pages only on "white" rows

Open ilanp13 opened this issue 8 years ago • 8 comments

ilanp13 avatar Oct 16 '17 10:10 ilanp13

hello,

i've added support to your library for splitting pages only on "white" canvas "rows", added comments on the code itself.

ilanp13 avatar Oct 16 '17 10:10 ilanp13

i believe it will solve the issues: https://github.com/eKoopmans/html2pdf/issues/26 https://github.com/eKoopmans/html2pdf/issues/13

ilanp13 avatar Oct 16 '17 10:10 ilanp13

It'll will take some time until i'll be able to work on this changes, will update when will be done.

ilanp13 avatar Oct 18 '17 09:10 ilanp13

Sure no worries, thanks again for the contribution!

eKoopmans avatar Oct 18 '17 12:10 eKoopmans

Hey @ilanp13, sorry I left you hanging. The changes look good! I just did a big restructuring to the code with v0.8.0, I'll take a look at working this in soon. I'm thinking I'll pull the page-break behaviour out into a separate module. Thanks again for the contribution!

eKoopmans avatar Nov 28 '17 08:11 eKoopmans

Hey folks. Is there any update on this PR? Would really love to use this feature. IMO it makes the difference between a professional looking output and not.

ScottStevenson avatar Feb 25 '18 01:02 ScottStevenson

Hi @ilanp13 , Thank you for the code. It's working in some scenarios for me. But I am trying to understand what the variable whiteColorLevel does here. I have a Uint8ClampedArray and in the pixel row, the first pixel RGBA values are 208,208,208,255, which is close to grey. But the method still returns true. What exactly is whiteColorLevel. Can you please explain me? capture1 capture

ngchen1 avatar May 18 '18 23:05 ngchen1

Hello! There are now 4 PRs for pagebreaks, and I know it's an important feature to many. I am looking into combining the PRs now and working them in.

eKoopmans avatar Sep 11 '18 14:09 eKoopmans