Skip to content

Commit

Permalink
fix default paper format in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
vintagesucks committed Mar 2, 2024
1 parent 592e9ea commit 35a8f31
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/basic-usage/formatting-pdfs.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Pdf::view('pdf.invoice', ['invoice' => $invoice])

## Paper format

By default, all PDFs are created in A4 format. You can change this by calling the `format` method.
By default, all PDFs are created in Letter format. You can change this by calling the `format` method.

```php
use Spatie\LaravelPdf\Facades\Pdf;
Expand Down
6 changes: 6 additions & 0 deletions tests/DefaultPdfTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@
->toContainText('test');
});

it('defaults to the letter format', function () {
Pdf::view('test')->save($this->targetPath);

expect($this->targetPath)->toHaveDimensions(612, 792);
});

it('will not use properties of the previous pdf when not setting a default', function () {
$firstPath = getTempPath('first.pdf');
Pdf::html('test')
Expand Down
2 changes: 1 addition & 1 deletion tests/PdfTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
expect(getTempPath('first.pdf'))
->toHaveDimensions(792, 612);

// second pdf is landscape
// second pdf is portrait
expect(getTempPath('second.pdf'))
->toHaveDimensions(612, 792);
});
Expand Down

0 comments on commit 35a8f31

Please sign in to comment.