Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML2PDF - The content of a TD tag does not fit on only one page

Tags:

php

html2pdf

Php produces pdf without issue when does not span, nested tables are not in use, and

HTML2PDF::$_subobj->pdf->getPage();

doesn't seem to address the bug/issue. Anyone run into this ERROR n°7?

like image 359
Dan Avatar asked Dec 10 '25 07:12

Dan


2 Answers

Add the following in your function to solve the error

html2pdf->setTestTdInOnePage(false);
like image 165
Craft Avatar answered Dec 11 '25 19:12

Craft


If you have a long picture (in table td) , example 1200px you can get this error. I fixed my picture to 600px and problem solved.

Example: My photo is 3000x2000 (width:height) I resized photo to 600x400.

like image 40
manowar_manowar Avatar answered Dec 11 '25 19:12

manowar_manowar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!