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 test39000  · 03-06-2024 - 10:32

Hello 

I'm using PHPDocx 13 and I have a problem when I try to merge 3 PDFs. I get the error “Unsupported operand types: string + int”, The problem seems to come from the function extractObjectStream() of the TCPDF library (TCPDF_autoconfig.php) which makes a regex 

$ints = preg_split('/\s/', substr($stream[0], 0, $first));

and returns an empty string in the return array, leading to the error at line 

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

where $ints[$j] is an empty string and $first is an integer and this is the reason for my error. 

The library is installed locally and changing the regex to '/\s+/' seems to correct the problem, but I don't have enough solid knowledge of the library and TCPDF to be sure that this won't cause side effects.

Has anyone come across this situation before? Where does the problem come from? And how did you fix it? Is my solution possible? 

Thanks