node-html-pdf
node-html-pdf copied to clipboard
Is there any way to make page breaks?
I'm trying to schematize a pdf, but there's no way to make page breaks.
Sorry, I don't know that this css style exists. Solved page break with:
style="page-break-after:always;"
Thanks! <br><div style="page-break-after:always;"></div> worked perfectly for me.
style="page-break-after:always;" Works perfect!
you can use media queries too:
@media print { p {page-break-inside: avoid;} h1 {page-break-before: always;} footer {page-break-after: always;} }
that may give anybody reading this an idea #2018 :)
@lucdetellis you are a god!
Sorry to revive an old thread, but have any of you had any luck doing the same with css grid? page-break-after doesn't seem to work within a grid.
Hi Techies, I am facing problem of page-break not working for table row (tr), I have tried all above methods but no luck, FYI ., i am using Nodejs, serverless framework having html-pdf as dependancy
if you are running into problems where "page-break-after: always;" does NOT work, then a cheap way to get around it is to install something like "merge-pdf-buffer" to merge multiple pdf buffers. It's how I solved my problem. instead of creating 1 pdf-buffer create multiple and merge them using the "merge-pdf-buffer" package.
guys can I get some help with this? https://stackoverflow.com/questions/69858192/add-page-break-to-ejs-template
style="page-break-after:always;" worked for me. Thanks