Skip to content

Commit

Permalink
[Bug]: Chrome shouldn't be closed when using Chrome service (#61)
Browse files Browse the repository at this point in the history
* fix chromium to close page instead of closing browser

Co-authored-by: Vincent Robert <[email protected]>

* Update Chromium.php

* Update Chromium.php

* remove empty spaces

---------

Co-authored-by: Vincent Robert <[email protected]>
  • Loading branch information
kingjia90 and vrobert78 authored Feb 19, 2024
1 parent 4151b8a commit a86b658
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Processor/Chromium.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ public function getPdfFromString(string $html, array $params = [], bool $returnF
]);
}

$page = $browser->createPage();
try {
$page = $browser->createPage();
$page->setHtml($html, 5000);

$pdf = $page->pdf($params);
Expand All @@ -136,7 +136,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;
Expand Down

0 comments on commit a86b658

Please sign in to comment.