Merge multiple files PDF become to one file PDF.


Posted on 2015-02-02 07:26:06

  1. You can download file then extract it to root folder. 2. If you run localhost/PDFMerge/sample.php, you see error show behind

Fatal error: Uncaught exception 'Exception' with message 'Error outputting PDF to 'file'.' in C:\xampp\htdocs\PDFMerger\PDFMerger.php:124 Stack trace: #0 C:\xampp\htdocs\PDFMerger\sample.php(8): PDFMerger->merge('file', 'samplepdfs/TEST...') #1 {main} thrown in C:\xampp\htdocs\PDFMerger\PDFMerger.php on line 124  
You can check to line 118 because line 118 is "if($fpdi->Output($outputpath, $mode))", but output returns “”. I changed the line 118 to read if($fpdi->Output($outputpath, $mode) == "") I have stopped returning error.

3. You can see file sample.php. File TEST2.pdf in folder samplepdfs which have been merged from three files “one.pdf, two.pdf. three.pdf”. 4. You can download source code demo at  PDFMerger_hainq