christopherdro / react-native-html-to-pdf

Convert html strings to PDF documents using React Native
MIT License
434 stars 264 forks source link

Page breaks? #215

Closed gburnett closed 2 years ago

gburnett commented 3 years ago

How does this library determine when to make a page break?

I've been trying it out and I find that elements can span two separate pages. Like this:

pageBreak

The structure of this example is very simple:

<html>
  <head></head>
  <body>
    <section style="border:solid 1px black;"><p>item</p></section>
    <!-- sections repeat n times -->
  </body>
</html>
GlobusHugoSchmitt commented 3 years ago

One can force a page break using this solution https://stackoverflow.com/questions/1664049/can-i-force-a-page-break-in-html-printing That doesn't help my issue, though. I want to add heading to all pages.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

aclowkey commented 1 year ago

Any ideas how to overcome this?

BrunoUno commented 1 year ago

Solution given by @GlobusHugoSchmitt works great !!! .