Skip to content

Commit 94de4fd

Browse files
authored
Merge pull request #40 from niklaswolf/master
bugfix for appending PDFs with version > 1.4
2 parents c9a888f + b7e3b5d commit 94de4fd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Pdf.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,11 @@ public function output($content = '', $file = '', $dest = self::DEST_BROWSER)
377377
* @param String $attachement
378378
*/
379379
private function writePdfAttachement ($api, $attachement){
380-
$pageCount = $api->SetSourceFile($attachement);
380+
try {
381+
$pageCount = $api->SetSourceFile($attachement);
382+
} catch (\MpdfException $e){
383+
$pageCount = 0;
384+
}
381385
for($i=1; $i<=$pageCount; $i++){
382386
$api->AddPage();
383387
$templateId = $api->ImportPage($i);

0 commit comments

Comments
 (0)