Skip to content

Commit 4787e3d

Browse files
committed
Add toFile() method to View
1 parent df7d3dc commit 4787e3d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Pdf/View.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ public function forceDownload(string $filename): self
4444
return $this;
4545
}
4646

47+
public function toFile(string $filename): void
48+
{
49+
$html = $this->view->render();
50+
51+
$this->pdf->render($html)->toFile($filename);
52+
}
53+
4754
public function render(): string
4855
{
4956
$html = $this->view->render();

0 commit comments

Comments
 (0)