tecnickcom / TCPDF

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

TypeError: Unsupported operand types: float + string in TCPDF->Write() (line 6442 ... tcpdf.php). #608

Open arx-e opened 1 year ago

arx-e commented 1 year ago

I was getting this error while using the library with Drupal module Views PDF 7.x-3.1 and TCPDF 6.6.2 (running php 8.0 or 8.1) TypeError: Unsupported operand types: float + string in TCPDF->Write() (line 6442 of ... /tcpdf/tcpdf.php).

The issue has been solved by the following modification to line 6442 of tcpdf.php: from this $maxy = $this->y + $maxh - max($row_height, $h); to this $maxy = $this->y + (float)$maxh - max($row_height, $h);

Following this suggestion https://phpcod.com/fatal-error-uncaught-typeerror-unsupported-operand-types-string-float/

talesvalente commented 1 year ago

Same here

williamdes commented 11 months ago

Does newer versions of TCPDF also have this issue ? Any patch of pull-request to fix it is very welcome