Skip to content

Commit b57ad08

Browse files
committed
Tweak options
1 parent 4d6b83d commit b57ad08

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"php": ">=8.1",
1818
"illuminate/support": "^9|^10",
1919
"illuminate/filesystem": "^9|^10",
20-
"pontedilana/php-weasyprint": "^1.2"
20+
"pontedilana/php-weasyprint": "^1.3"
2121
},
2222
"require-dev": {
2323
"orchestra/testbench": "^7|^8",

config/weasyprint.php

+10-10
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
| Options:
2222
|
2323
| The WeasyPrint command options.
24-
| See https://doc.courtbouillon.org/weasyprint/latest/api_reference.html#command-line-api
24+
| See https://doc.courtbouillon.org/weasyprint/latest/api_reference.html#weasyprint.DEFAULT_OPTIONS
2525
|
2626
| Env:
2727
|
@@ -31,20 +31,20 @@
3131

3232
'pdf' => [
3333
'binary' => env('WEASYPRINT_BINARY', '/usr/local/bin/weasyprint'),
34-
'timeout' => false,
34+
'timeout' => 10, // Default timeout is 10 seconds
3535
'options' => [
3636
'encoding' => null,
37-
'stylesheet' => [],
38-
'media-type' => null,
37+
'stylesheet' => [], //An optional list of user stylesheets. The list can include are CSS objects, filenames, URLs, or file-like objects.s
38+
'media-type' => null, //Media type to use for @media.
3939
'base-url' => null,
40-
'attachment' => [],
40+
'attachment' => [], //A list of additional file attachments for the generated PDF document
4141
'presentational-hints' => null,
42-
'pdf-identifier' => null,
43-
'pdf-variant' => null,
44-
'pdf-version' => null,
45-
'pdf-forms' => null,
42+
'pdf-identifier' => null, // A bytestring used as PDF file identifier.
43+
'pdf-variant' => null, // A PDF variant name.
44+
'pdf-version' => null, // A PDF version number.
45+
'pdf-forms' => null, // (bool) Whether PDF forms have to be included.
4646
'custom-metadata' => null,
47-
'uncompressed-pdf' => null,
47+
'uncompressed-pdf' => null, //Whether PDF content should be compressed.
4848
'full-fonts' => null,
4949
'hinting' => null,
5050
'dpi' => null,

src/WeasyPrintProvider.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function boot()
3737
$timeout = $app['config']->get('weasyprint.pdf.timeout', false);
3838

3939
$weasy = new IlluminateWeasyPrintPdf($app['files'], $binary, $options, $env);
40-
if (false !== $timeout) {
40+
if ($timeout && is_int($timeout)) {
4141
$weasy->setTimeout($timeout);
4242
}
4343

0 commit comments

Comments
 (0)