Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there any way to make page breaks? #49

Open
ghost opened this issue Jul 21, 2015 · 10 comments
Open

Is there any way to make page breaks? #49

ghost opened this issue Jul 21, 2015 · 10 comments
Labels

Comments

@ghost
Copy link

ghost commented Jul 21, 2015

I'm trying to schematize a pdf, but there's no way to make page breaks.

@ghost
Copy link
Author

ghost commented Jul 21, 2015

Sorry, I don't know that this css style exists. Solved page break with:

style="page-break-after:always;"

@lucdetellis
Copy link

Thanks! <br><div style="page-break-after:always;"></div> worked perfectly for me.

@vrunoa
Copy link

vrunoa commented Aug 7, 2015

style="page-break-after:always;" Works perfect!

@zurcacielos
Copy link

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 :)

@vieiralucas
Copy link

@lucdetellis you are a god!

@selven
Copy link

selven commented Sep 4, 2019

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.

@somasekharn
Copy link

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

@aleem-ahmed
Copy link

aleem-ahmed commented Jun 3, 2021

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.

@AhsanNissar
Copy link

guys can I get some help with this? https://stackoverflow.com/questions/69858192/add-page-break-to-ejs-template

@PriyankMotivaras
Copy link

style="page-break-after:always;" worked for me. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

10 participants