TCPDF icon indicating copy to clipboard operation
TCPDF copied to clipboard

Deprecation warnings in PHP 8.2.22

Open IcetipsAlta opened this issue 1 year ago • 1 comments

I'm aware that this is the old version which is pretty much closed while the new one is in development.

After updating to the latest build of the "old" version, and also upgrading to PHP 8.2.22 I got a few deprecation warnings from PHP most notably on like 4138 and 4139 in tcpdf.php

Deprecated: Implicit conversion from float x.xxxxx to int loses precision in path\pdf_library\tcpdf.php on line 4138
Deprecated: Implicit conversion from float x.xxxxx to int loses precision in path\pdf_library\tcpdf.php on line 4139

The x.xxxxx varies and on a 2-3 page report this returns about 2,900 warnings. This refers to the getRawCharWidth method and those two lines of code:

if (isset($this->CurrentFont['cw'][$char])) {
    $w = $this->CurrentFont['cw'][$char];

Is there anything that I can do to fix this to get around this problem?

IcetipsAlta avatar Aug 29 '24 15:08 IcetipsAlta

Is there anything that I can do to fix this to get around this problem?

Upgrade TCPDF. In the current version (6.7.6), the values are explicitly converted.

littlepackage avatar Oct 12 '24 13:10 littlepackage