This repository was archived by the owner on Apr 14, 2024. It is now read-only.
File tree 5 files changed +20
-2
lines changed
5 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,6 @@ services:
12
12
- ./:/usr/src/app:rw
13
13
14
14
gotenberg :
15
- image : thecodingmachine/gotenberg:4
15
+ image : thecodingmachine/gotenberg:4.1
16
16
container_name : gotenberg
17
17
restart : ' no'
Original file line number Diff line number Diff line change @@ -31,6 +31,9 @@ abstract class ChromeRequest extends Request implements GotenbergRequestInterfac
31
31
/** @var bool */
32
32
protected $ landscape ;
33
33
34
+ /** @var int|null */
35
+ protected $ webFontsTimeout ;
36
+
34
37
/**
35
38
* @return array<string,mixed>
36
39
*/
@@ -58,6 +61,9 @@ public function getFormValues(): array
58
61
if (!is_null ($ this ->marginRight )) {
59
62
$ values [self ::MARGIN_RIGHT ] = $ this ->marginRight ;
60
63
}
64
+ if (!is_null ($ this ->webFontsTimeout )) {
65
+ $ values [self ::WEB_FONTS_TIMEOUT ] = $ this ->webFontsTimeout ;
66
+ }
61
67
$ values [self ::LANDSCAPE ] = $ this ->landscape ;
62
68
return $ values ;
63
69
}
@@ -176,4 +182,12 @@ public function setLandscape(bool $landscape): void
176
182
{
177
183
$ this ->landscape = $ landscape ;
178
184
}
185
+
186
+ /**
187
+ * @param int|null $webFontsTimeout
188
+ */
189
+ public function setWebFontsTimeout (?int $ webFontsTimeout ): void
190
+ {
191
+ $ this ->webFontsTimeout = $ webFontsTimeout ;
192
+ }
179
193
}
Original file line number Diff line number Diff line change 9
9
use Psr \Http \Message \RequestInterface ;
10
10
use Psr \Http \Message \ResponseInterface ;
11
11
use Safe \Exceptions \FilesystemException ;
12
- use function Safe \mkdir ;
13
12
use function Safe \fopen ;
14
13
use function Safe \fwrite ;
15
14
use function Safe \fclose ;
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ abstract class Request
25
25
protected const MARGIN_LEFT = 'marginLeft ' ;
26
26
protected const MARGIN_RIGHT = 'marginRight ' ;
27
27
protected const LANDSCAPE = 'landscape ' ;
28
+ protected const WEB_FONTS_TIMEOUT = 'webFontsTimeout ' ;
28
29
29
30
/** @var string|null */
30
31
protected $ webhookURL ;
Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ private function createHTMLRequest(): HTMLRequest
56
56
$ request ->setAssets ($ assets );
57
57
$ request ->setPaperSize (Request::A4 );
58
58
$ request ->setMargins (Request::NO_MARGINS );
59
+ $ request ->setWebFontsTimeout (500 );
59
60
return $ request ;
60
61
}
61
62
@@ -72,6 +73,7 @@ private function createURLRequest(): URLRequest
72
73
$ request ->setFooter ($ footer );
73
74
$ request ->setPaperSize (Request::A4 );
74
75
$ request ->setMargins (Request::NO_MARGINS );
76
+ $ request ->setWebFontsTimeout (500 );
75
77
return $ request ;
76
78
}
77
79
@@ -100,6 +102,7 @@ public function createMarkdownRequest(): MarkdownRequest
100
102
$ request ->setAssets ($ assets );
101
103
$ request ->setPaperSize (Request::A4 );
102
104
$ request ->setMargins (Request::NO_MARGINS );
105
+ $ request ->setWebFontsTimeout (500 );
103
106
return $ request ;
104
107
}
105
108
@@ -125,6 +128,7 @@ public function createMergeRequest(): MergeRequest
125
128
DocumentFactory::makeFromPath ('gotenberg2.pdf ' , __DIR__ . '/assets/pdf/gotenberg.pdf ' ),
126
129
];
127
130
$ request = new MergeRequest ($ files );
131
+
128
132
return $ request ;
129
133
}
130
134
You can’t perform that action at this time.
0 commit comments