QuilhaSoft / JasperPHP

Pure PHP library to read JRXML files made in "JasperSoft Studio" and generate reports in PDF/XLS
https://jasperphp.net
MIT License
63 stars 25 forks source link

PHP 8.2 support #99

Closed allgood closed 7 months ago

allgood commented 1 year ago

When using php 8.2 tcpdf have some failures with the bad use of strpos inverting the parameters.

Solution appears to be update to recent tcpdf

allgood commented 7 months ago

Hi @Rctnet ,

This problem can be observed when report have an object of type Rectangle.

PHP version 7.4 issues a warning:

PHP Warning:  strpos() expects parameter 1 to be string, array given in /home/allgood/Projetos/JasperPHP/vendor/tecnickcom/tcpdf/tcpdf.php on line 11575
allgood commented 7 months ago

Another problem is that when a textfield have the "StretchHeight" property set, php7.4 gives a warning, and php8.2 gives an error:

PHP Warning:  A non-numeric value encountered in /home/allgood/Projetos/JasperPHP/vendor/tecnickcom/tcpdf/tcpdf.php on line 6371
allgood commented 7 months ago

Another php 8.2 issue is about line widths on static text, text fields and table cells.

If they are lower than 1, like 0.5 or 0.25, they don't appears at all.

That is because of a float to integer comparison. I didn´t found what changed on php but a simple change on the comparisons solved the problem.