Reputation: 1412
I have a issue trying to display large chunks of text coming from a sql table on a pdf file created with Tcpdf. The layout of the pdf consists of a header, a footer and several cells of text. When the last cell of text overflows the page, the next page shows the remaining text over the header of the next page. The problem is that the text isn't putted line by line on the file but it's dumped completely into the cell. Is there a way to prevent this behavior? Any idea of how to trim the text so it can fix in two cells on two pages?
Any help or idea will be appreciated.
Upvotes: 0
Views: 3135
Reputation: 2923
Are you are using TCPDF's writeHTML()
method to generate your PDF?
If so I'd highly recommend using TCPDF's built in functions for laying out your page - TCPDF is a decent library, but in my experience if you attempt to layout with a half implementation of HTML then it's always a headache.
If you're not using html then try setting the page margins or split up your text using PHP's substr()
and then set the AutoPageBreak
in TCPDF
Upvotes: 1