hanneskod/libmergepdf

Unable to find PDF file header

Closed this issue · 1 comments

I always get the same error. The PDFs are 1.7 and individually I can get them without problems.

`$pdfMerge = new Merger();
$curl = $this->createCurlObject();

    foreach ($pdfs as $pdf){
        try {
            $file = tempnam(sys_get_temp_dir(), 'DOC');
            $curl->download($pdf->url, $file);
            $pdfMerge->addFile($file);
          .....

`

when I make the merge and try to return, the error comes

return $pdfMerge->merge() ==> Unable to find PDF file header

PHP 7.0.33-1~dotdeb+8.1 with libmergepdf version 3.1.1

If you can downlad the files manually and then merge them without error it is not an issue with this library, but rather something with to downloading strategy. I'm closing for now. Feel free to reopen if you find a specific library error.