Forum


Replies: 4   Views: 364
Pdf merge returns unsupported operand types: string + int
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by admin  · 03-06-2024 - 14:58

Hello,

Sorry, but we would need to check a PDF sample to know the source of the issue and if it uses a valid internal structure or it could be repaired (https://www.phpdocx.com/documentation/cookbook/repair-PDF). 

We have done some quick tests with your change and it's working correctly, but we think the best approach would be to use:

$this->objstreamobjs[$ints[$j-1]] = array($key, ((int)$ints[$j])+$first);

instead of changing the regex, but without a sample PDF file it's not possible to know the best solution and the exact problem.

What PHP version are you using? Do you get a PHP Error, a PHP Warning, or a PHP Notice? We have done some tests with PHP 5.6, PHP 7.4, PHP 8.0, PHP 8.1, PHP 8.2, and PHP 8.3 and the error doesn't appear. Do you get the same error if you run the samples included in the package? Are you using some debugger that may change the default error reporting such as xdebug? In any case, we have included the previous change in the current testing branch of phpdocx.

Regards.