This project is read-only.
2
Vote

Error when executing...

description

after executing

php sample.php

 
PHP Fatal error: Uncaught exception 'Exception' with message 'Error outputting PDF to 'file'.' in /home/runman/PDFMerger/PDFMerger.php:124
Stack trace:

0 /home/runman/PDFMerger/sample.php(9): PDFMerger->merge('file', 'samplepdfs/TEST...')

1 {main}

thrown in /home/runman/PDFMerger/PDFMerger.php on line 124
 
TEST2.pdf file after looks ok, but what is with error ?

comments

QuestionMarc wrote Mar 17, 2012 at 8:35 PM

The error has to do with the return value for the Output function. The if statement in the PDFMerger.php file on line 118 is "if($fpdi->Output($outputpath, $mode))", but Output returns '' not a true/false. I changed the line 118 to read ""if($fpdi->Output($outputpath, $mode) == '')" and it stopped returning the error.

Naahuel wrote Jan 30, 2013 at 6:37 PM

You are the man. Thank you, this saved me some headaches!

wrote Feb 21, 2013 at 11:52 PM

wrote Jan 15, 2014 at 3:53 AM