Node-html-pdf: Multiple Pages Docs On separate Pages

Created on 6 Apr 2018  路  7Comments  路  Source: marcbachmann/node-html-pdf

Currently, whole HTML doc is printed out what if we need to print separately docs pages in one pdf but different pages

Most helpful comment

In CSS use:

.pb_before { page-break-before: always !important; } /* Breaks page before of element */
.pb_after  { page-break-after: always !important; } /* Breaks page after of element */
.pbi_avoid { page-break-inside: avoid !important; } /* Avoid breaks page in element */

In JS use camel case:

pb_before: { pageBreakBefore: 'always !important' } /* Breaks page before of element */
pb_after:  { pageBreakAfter: 'always !important' } /* Breaks page after of element */
pbi_avoid: { pageBreakInside: 'avoid !important' } /* Avoid breaks page in element */

All 7 comments

I also face the same issue,
When I have multiple html content to be shown separately on different pdf pages. I can't find any solution.

same here, any solutions?

Not yet, once done will post it

im using the css rule page-break-after: always for multi page, i hope it works for u too

In CSS use:

.pb_before { page-break-before: always !important; } /* Breaks page before of element */
.pb_after  { page-break-after: always !important; } /* Breaks page after of element */
.pbi_avoid { page-break-inside: avoid !important; } /* Avoid breaks page in element */

In JS use camel case:

pb_before: { pageBreakBefore: 'always !important' } /* Breaks page before of element */
pb_after:  { pageBreakAfter: 'always !important' } /* Breaks page after of element */
pbi_avoid: { pageBreakInside: 'avoid !important' } /* Avoid breaks page in element */

Thanks guys,
page-break works well.

Not working for me. I wonder if it is because I'm using flex and grid

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aminjoharinia picture aminjoharinia  路  4Comments

Mortuie picture Mortuie  路  4Comments

RodolfoSilva picture RodolfoSilva  路  3Comments

sca88 picture sca88  路  4Comments

adman020 picture adman020  路  5Comments