Skip to content
This repository was archived by the owner on Apr 14, 2024. It is now read-only.

Commit 44e0369

Browse files
author
Julien Neuhart
authored
adding googleChromeRpccBufferSize (#8)
1 parent 195bf7d commit 44e0369

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

docker-compose.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ services:
1212
- ./:/usr/src/app:rw
1313

1414
gotenberg:
15-
image: thecodingmachine/gotenberg:6.0.0
15+
image: thecodingmachine/gotenberg:6.0.1
1616
container_name: gotenberg
1717
restart: 'no'

src/ChromeRequest.php

+12
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ abstract class ChromeRequest extends Request implements GotenbergRequestInterfac
1616
private const MARGIN_LEFT = 'marginLeft';
1717
private const MARGIN_RIGHT = 'marginRight';
1818
private const LANDSCAPE = 'landscape';
19+
private const GOOGLE_CHROME_RPCC_BUFFER_SIZE = 'googleChromeRpccBufferSize';
1920

2021
/** @var float|null */
2122
private $waitDelay;
@@ -47,6 +48,9 @@ abstract class ChromeRequest extends Request implements GotenbergRequestInterfac
4748
/** @var bool */
4849
private $landscape;
4950

51+
/** @var int|null */
52+
private $googleChromeRpccBufferSize;
53+
5054
/**
5155
* @return array<string,mixed>
5256
*/
@@ -74,6 +78,9 @@ public function getFormValues(): array
7478
if ($this->marginRight !== null) {
7579
$values[self::MARGIN_RIGHT] = $this->marginRight;
7680
}
81+
if ($this->googleChromeRpccBufferSize !== null) {
82+
$values[self::GOOGLE_CHROME_RPCC_BUFFER_SIZE] = $this->googleChromeRpccBufferSize;
83+
}
7784
$values[self::LANDSCAPE] = $this->landscape;
7885

7986
return $values;
@@ -174,4 +181,9 @@ public function setLandscape(bool $landscape): void
174181
{
175182
$this->landscape = $landscape;
176183
}
184+
185+
public function setGoogleChromeRpccBufferSize(?int $googleChromeRpccBufferSize): void
186+
{
187+
$this->googleChromeRpccBufferSize = $googleChromeRpccBufferSize;
188+
}
177189
}

tests/ClientTest.php

+3
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ private function createHTMLRequest(): HTMLRequest
6161
$request->setAssets($assets);
6262
$request->setPaperSize(Request::A4);
6363
$request->setMargins(Request::NO_MARGINS);
64+
$request->setGoogleChromeRpccBufferSize(1048576);
6465

6566
return $request;
6667
}
@@ -80,6 +81,7 @@ private function createURLRequest(): URLRequest
8081
$request->setFooter($footer);
8182
$request->setPaperSize(Request::A4);
8283
$request->setMargins(Request::NO_MARGINS);
84+
$request->setGoogleChromeRpccBufferSize(1048576);
8385

8486
return $request;
8587
}
@@ -111,6 +113,7 @@ public function createMarkdownRequest(): MarkdownRequest
111113
$request->setAssets($assets);
112114
$request->setPaperSize(Request::A4);
113115
$request->setMargins(Request::NO_MARGINS);
116+
$request->setGoogleChromeRpccBufferSize(1048576);
114117

115118
return $request;
116119
}

0 commit comments

Comments
 (0)