Skip to content

Commit

Permalink
Fix setOptions (#1040)
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarreyes3 authored Mar 15, 2024
1 parent cb37868 commit 3fabaa2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/PDF.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,15 @@ public function setOption($attribute, $value = null): self
/**
* Replace all the Options from DomPDF
*
* @deprecated Use setOption to override individual options.
* @param array<string, mixed> $options
*/
public function setOptions(array $options): self
public function setOptions(array $options, bool $mergeWithDefaults = false): self
{
$options = new Options($options);
$this->dompdf->setOptions($options);
if ($mergeWithDefaults) {
$options = array_merge(app()->make('dompdf.options'), $options);
}

$this->dompdf->setOptions(new Options($options));
return $this;
}

Expand Down

0 comments on commit 3fabaa2

Please sign in to comment.