pimcore / web-to-print-bundle

Web-to-Print community bundle adds web-to-print features to Pimcore documents.
https://pimcore.com/docs/platform/Web_To_Print/
Other
4 stars 12 forks source link

Chrome shouldn't be closed when using Chrome service #58

Closed brusch closed 7 months ago

brusch commented 8 months ago

Currently the browser gets closed after rendering here: https://github.com/pimcore/web-to-print-bundle/blob/1.x/src/Processor/Chromium.php#L139

Actually this causes issues when using Chrome as as a container service, e.g. ws://chrome:3000/

The following patch fixes the issue:

diff --git a/src/Processor/Chromium.php b/src/Processor/Chromium.php
index dafc77c..4d1b25a 100644
--- a/src/Processor/Chromium.php
+++ b/src/Processor/Chromium.php
@@ -136,7 +136,7 @@ class Chromium extends Processor
             Logger::debug('Could not create pdf with chromium: '. print_r($e, true));
             $output = (string) $e;
         } finally {
-            $browser->close();
+            $page->close();
         }

         return $output;

Credits: @vrobert78 many thanks 👍😊

exalate-issue-sync[bot] commented 7 months ago

JiaJia Ji commented: Fixed by [https://github.com/pimcore/web-to-print-bundle/pull/61|https://github.com/pimcore/web-to-print-bundle/pull/61|smart-link]