This repository was archived by the owner on Apr 14, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +14
-0
lines changed
Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Original file line number Diff line number Diff line change 5656 $request->setAssets($assets);
5757 $request->setPaperSize(Request::A4);
5858 $request->setMargins(Request::NO_MARGINS);
59+ $request->setScale(0.75);
5960
6061 # store method allows you to... store the resulting PDF in a particular destination.
6162 $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
1818 private const LANDSCAPE = 'landscape ' ;
1919 private const PAGE_RANGES = 'pageRanges ' ;
2020 private const GOOGLE_CHROME_RPCC_BUFFER_SIZE = 'googleChromeRpccBufferSize ' ;
21+ private const SCALE = 'scale ' ;
2122
2223 /** @var float|null */
2324 private $ waitDelay ;
@@ -55,6 +56,9 @@ abstract class ChromeRequest extends Request implements GotenbergRequestInterfac
5556 /** @var int|null */
5657 private $ googleChromeRpccBufferSize ;
5758
59+ /** @var float|null */
60+ private $ scale ;
61+
5862 /**
5963 * @return array<string,mixed>
6064 */
@@ -88,6 +92,9 @@ public function getFormValues(): array
8892 if ($ this ->googleChromeRpccBufferSize !== null ) {
8993 $ values [self ::GOOGLE_CHROME_RPCC_BUFFER_SIZE ] = $ this ->googleChromeRpccBufferSize ;
9094 }
95+ if ($ this ->scale !== null ) {
96+ $ values [self ::SCALE ] = $ this ->scale ;
97+ }
9198 $ values [self ::LANDSCAPE ] = $ this ->landscape ;
9299
93100 return $ values ;
@@ -198,4 +205,9 @@ public function setGoogleChromeRpccBufferSize(?int $googleChromeRpccBufferSize):
198205 {
199206 $ this ->googleChromeRpccBufferSize = $ googleChromeRpccBufferSize ;
200207 }
208+
209+ public function setScale (?float $ scale ): void
210+ {
211+ $ this ->scale = $ scale ;
212+ }
201213}
Original file line number Diff line number Diff line change @@ -62,6 +62,7 @@ private function createHTMLRequest(): HTMLRequest
6262 $ request ->setPaperSize (Request::A4 );
6363 $ request ->setMargins (Request::NO_MARGINS );
6464 $ request ->setGoogleChromeRpccBufferSize (1048576 );
65+ $ request ->setScale (0.9 );
6566
6667 return $ request ;
6768 }
You can’t perform that action at this time.
0 commit comments