This repository was archived by the owner on Apr 14, 2024. It is now read-only.
File tree 3 files changed +14
-0
lines changed
3 files changed +14
-0
lines changed Original file line number Diff line number Diff line change 56
56
$request->setAssets($assets);
57
57
$request->setPaperSize(Request::A4);
58
58
$request->setMargins(Request::NO_MARGINS);
59
+ $request->setScale(0.75);
59
60
60
61
# store method allows you to... store the resulting PDF in a particular destination.
61
62
$client->store($request, 'path/you/want/the/pdf/to/be/stored.pdf');
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ abstract class ChromeRequest extends Request implements GotenbergRequestInterfac
18
18
private const LANDSCAPE = 'landscape ' ;
19
19
private const PAGE_RANGES = 'pageRanges ' ;
20
20
private const GOOGLE_CHROME_RPCC_BUFFER_SIZE = 'googleChromeRpccBufferSize ' ;
21
+ private const SCALE = 'scale ' ;
21
22
22
23
/** @var float|null */
23
24
private $ waitDelay ;
@@ -55,6 +56,9 @@ abstract class ChromeRequest extends Request implements GotenbergRequestInterfac
55
56
/** @var int|null */
56
57
private $ googleChromeRpccBufferSize ;
57
58
59
+ /** @var float|null */
60
+ private $ scale ;
61
+
58
62
/**
59
63
* @return array<string,mixed>
60
64
*/
@@ -88,6 +92,9 @@ public function getFormValues(): array
88
92
if ($ this ->googleChromeRpccBufferSize !== null ) {
89
93
$ values [self ::GOOGLE_CHROME_RPCC_BUFFER_SIZE ] = $ this ->googleChromeRpccBufferSize ;
90
94
}
95
+ if ($ this ->scale !== null ) {
96
+ $ values [self ::SCALE ] = $ this ->scale ;
97
+ }
91
98
$ values [self ::LANDSCAPE ] = $ this ->landscape ;
92
99
93
100
return $ values ;
@@ -198,4 +205,9 @@ public function setGoogleChromeRpccBufferSize(?int $googleChromeRpccBufferSize):
198
205
{
199
206
$ this ->googleChromeRpccBufferSize = $ googleChromeRpccBufferSize ;
200
207
}
208
+
209
+ public function setScale (?float $ scale ): void
210
+ {
211
+ $ this ->scale = $ scale ;
212
+ }
201
213
}
Original file line number Diff line number Diff line change @@ -62,6 +62,7 @@ private function createHTMLRequest(): HTMLRequest
62
62
$ request ->setPaperSize (Request::A4 );
63
63
$ request ->setMargins (Request::NO_MARGINS );
64
64
$ request ->setGoogleChromeRpccBufferSize (1048576 );
65
+ $ request ->setScale (0.9 );
65
66
66
67
return $ request ;
67
68
}
You can’t perform that action at this time.
0 commit comments