2

I am currently evaluating a number of html to pdf packages. Most seem to correctly insert a page break when using the following:

<tbody style="page-break-inside: avoid;">

However it does not seem to be working for me with iText7 7.1.2 and pdfHtml 2.0.2. Is there a particular converter property to set? Does this only work for some HTML elements?

**Note: ** One detail of this is that the input is an HTML stream, not a static file.

K J
  • 602
  • 1
  • 9
  • 18
  • This looks to be the same issue as: https://stackoverflow.com/q/50372100/513847 – K J May 22 '18 at 21:39

1 Answers1

1

I believe the following question is similar and may answer your question that you're having about page breaks.

how can I make a page break using itext

Dale
  • 1,613
  • 4
  • 22
  • 42
  • Thanks Dale. The input is streamed HTML, so at best manually adding the page breaks would be fragile in this scenario. – K J May 22 '18 at 21:28
  • 1
    Good point. In looking into this a bit more, I see there is another question that points to some other solutions that might work. I haven't looked into your particular issue, however, this might help you solve your problem. Good luck. https://softwarerecs.stackexchange.com/questions/36861/free-for-commercial-use-java-library-to-convert-html-to-pdf – Dale May 23 '18 at 03:34
  • Thanks again Dale. There were a few other packages that did not have this issue with the page break css. We ended up choosing to go with SelectPDF for our solution. – K J May 23 '18 at 17:35