diff --git a/public/js/document/printpages/pdf_preview.js b/public/js/document/printpages/pdf_preview.js index 47d6154..96f6542 100644 --- a/public/js/document/printpages/pdf_preview.js +++ b/public/js/document/printpages/pdf_preview.js @@ -92,7 +92,7 @@ pimcore.document.printpages.pdfpreview = Class.create({ style: "float: right; margin-top: 10px", handler: function () { var date = new Date(); - var url = Routing.generate('pimcore_bundle_document_printpage_pdfdownload', {id: this.page.id, download: 1, time: date.getTime()}); + var url = Routing.generate('pimcore_bundle_web2print_document_printpage_pdfdownload', {id: this.page.id, download: 1, time: date.getTime()}); pimcore.helpers.download(url); }.bind(this) }); diff --git a/src/Processor/Chromium.php b/src/Processor/Chromium.php index dafc77c..b09ca7d 100644 --- a/src/Processor/Chromium.php +++ b/src/Processor/Chromium.php @@ -120,8 +120,9 @@ public function getPdfFromString(string $html, array $params = [], bool $returnF ]); } + $page = $browser->createPage(); + try { - $page = $browser->createPage(); $page->setHtml($html, 5000); $pdf = $page->pdf($params); @@ -136,7 +137,7 @@ public function getPdfFromString(string $html, array $params = [], bool $returnF Logger::debug('Could not create pdf with chromium: '. print_r($e, true)); $output = (string) $e; } finally { - $browser->close(); + $page->close(); } return $output;