gus_dancy
02/10/2022, 11:09 PMgus_dancy
02/10/2022, 11:13 PMMark Takata (Adobe)
02/10/2022, 11:17 PM<div style="page-break-before:always"> </div>
and occasionally using:
<cfdocumentitem type="pagebreak"/>
Again, been a minute, but those seemed to work. Something to keep in mind is to make sure your HTML is valid. If something in your loop messes up your HTML (doesn't close a tag properly, invalid table structure, etc) for whatever reason it can cause issues with breaks rendering correctly.drewnathanson
02/10/2022, 11:18 PMgus_dancy
02/11/2022, 4:27 PMgus_dancy
02/11/2022, 4:32 PMgus_dancy
02/11/2022, 4:33 PMMark Takata (Adobe)
02/11/2022, 4:34 PMMark Takata (Adobe)
02/11/2022, 4:34 PMgus_dancy
02/11/2022, 4:44 PMgus_dancy
02/11/2022, 5:12 PMgus_dancy
02/11/2022, 5:14 PMgus_dancy
02/11/2022, 9:22 PMDavid Buck
02/14/2022, 2:14 PMpage-break-inside: avoid
with <cfhtmltopdf>
, and it doesn't work there either (at least, not in CF 2016). Wkhtmltopdf-- which I believe <cfhtmltopdf>
is based on-- does supposedly support page-break-inside: avoid
, so I'm not sure why CF doesn't. Maybe it's using an older version or something.
If you really want good page-break handling with dynamic content, you might want to look into using wkhtmltopdf directly, or another 3rd party tool like WeasyPrint, or even Headless Chrome (I used non-headless Firefox, started via cfexecute, together with a PDF printer, for this exact reason, and it worked great for many years; nothing beats a browser for rendering HTML/CSS).