tecnickcom / TCPDF

Official clone of PHP library to generate PDF documents and barcodes
https://tcpdf.org
Other
4.18k stars 1.51k forks source link

getting PHP warnings with PHP8.0 #482

Open simogeo opened 2 years ago

simogeo commented 2 years ago

Hello,

Using v6.4.4,I still have some PHP warnings :

PHP Warning: Undefined array key "x" in /lib/vendor/TCPDF/tcpdf.php on line 17465
[08-Feb-2022 15:04:16 Europe/Paris] PHP Warning: Undefined array key "x" in /lib/vendor/TCPDF/tcpdf.php on line 17466
[08-Feb-2022 15:04:16 Europe/Paris] PHP Warning: Undefined array key "xmax" in /lib/vendor/TCPDF/tcpdf.php on line 17467
[08-Feb-2022 15:04:16 Europe/Paris] PHP Warning: Trying to access array offset on value of type null in /lib/vendor/TCPDF/tcpdf.php on line 2468 

Am I the only one ? Any help will be welcome ! Thanks for your answer

THenkeDE commented 2 years ago

I am using PHP 8.0 at the moment and i have this ugly stuff, too.

When i use nobr="true" on table tags and auto pagebreak is active. When it comes to the situation that the table will reach the page end it is supposed to be moved to the next page but the error pops in on line 17465

$xoffset = ($this->x - $dom[$dom[$key]['parent']]['borderposition']['x']);

THenkeDE commented 2 years ago

additional: This only happens when you use a thead in your table (which you obviously do so it repeats on the next page). Moving the thead content to the tbody is no real solution but may fix it for you, if you do not need repeating theads.