cesarvr / pdf-generator

Cordova plugin to generate pdf in the client-side
MIT License
107 stars 61 forks source link

Multiple Page Pdf #87

Closed ebarolo closed 4 years ago

ebarolo commented 5 years ago

Hi, How it's possibile to generate multiple page pdf from html?

Thank You

cesarvr commented 5 years ago

Hi @ebarolo the plugin draw the page in a browser behind the scene, so you need to put enough padding in between the content.

Example:

<h1 style="margin-bottom: 900px">page 1</h1>
 <!--  That margin-bottom parameter will push the content down -->

<h1 style="margin-bottom: 900px">page 2</h1>
 <!--  And so on. -->

You need to play with those values, to achieve the desired effect.

Also here is some examples one of it does multi-page.
pdf-generator-example

lukawal-miller commented 4 years ago

Just add to your HTML style="page-break-before: always; on the last element and everything after that will be on next page.

merbin2012 commented 11 months ago

Hi @ebarolo the plugin draw the page in a browser behind the scene, so you need to put enough padding in between the content.

Example:

<h1 style="margin-bottom: 900px">page 1</h1>
 <!--  That margin-bottom parameter will push the content down -->

<h1 style="margin-bottom: 900px">page 2</h1>
 <!--  And so on. -->

You need to play with those values, to achieve the desired effect.

Also here is some examples one of it does multi-page. pdf-generator-example

This is not working

merbin2012 commented 11 months ago

Just add to your HTML style="page-break-before: always; on the last element and everything after that will be on next page.

Thank you, this is working