Skip to content

Commit

Permalink
accept unit for papersize
Browse files Browse the repository at this point in the history
  • Loading branch information
freekmurze committed Jan 14, 2024
1 parent 0a4d46e commit 0357549
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/PdfBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,12 @@ public function format(string|Format $format): self
return $this;
}

public function paperSize(float $width, float $height, string $unit = 'mm'): self
public function paperSize(float $width, float $height, Unit|string $unit = 'mm'): self
{
if ($unit instanceof Unit) {
$unit = $unit->value;
}

$this->withBrowsershot(function (Browsershot $browsershot) use ($width, $height, $unit) {
$browsershot->paperSize($width, $height, $unit);
});
Expand Down

0 comments on commit 0357549

Please sign in to comment.