[Html2PdfConverter] PDF, page-break and table of records

[Html2PdfConverter] PDF, page-break and table of records

  
Forge Component
(48)
Published on 20 Mar by Guilherme Pereira
48 votes
Published on 20 Mar by Guilherme Pereira

Hi.

I'm using this module to make a PFD document. The document is made but I have a table in there that gets cut in half, to page 1 and 2. I have tried every tip and trick I have found here on the forum and on the internet but nothing works (incl. page-break-before, after, inside etc.).

I have the pdf screen in a webflow with only the Lisbon theme, tried the css on the table itself and then on the container. I have literally search the end of the internet to try to find a solution. 

I tried using SimpleReports but I didn't seem to get the tables to break like the do there.

Does anyone have any suggestions for me?

Crossing my fingers for some help.

With best regards,

Íris


HI Iris,

Can you share an URL to the PDF generation and the module (or a similar replication if it contains sensitive information) so we can take a look?

Cheers,

Guilherme

Hi Íris,

I had a similiar experience with generating pdf with tables inside, and it got me stuck aswell. After many hours of trying every workaround i could find, i opted for the not so great (yet fully functional) approach: 

Implemented the logic to build the Html table in preparation, and it worked like a charm.

In my case i had a webblock that was being used both in a regular page and in the pdf generation page, so i maintained the original Table Records widget but enclosed it in an If


Also to mention that i just added the default classes (TableRecords in <table> TableRecords_Header in <th>s  and  TableRecords_OddLine & TableRecords_EvenLine in <tr>s) to get the same look and feel and added this to the pdf page's css property

table { page-break-inside:auto }
tr    { page-break-inside:avoid; page-break-after:auto }