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

adding googleChromeRpccBufferSize #8

Merged
merged 1 commit into from
Oct 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ services:
- ./:/usr/src/app:rw

gotenberg:
image: thecodingmachine/gotenberg:6.0.0
image: thecodingmachine/gotenberg:6.0.1
container_name: gotenberg
restart: 'no'
12 changes: 12 additions & 0 deletions src/ChromeRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ abstract class ChromeRequest extends Request implements GotenbergRequestInterfac
private const MARGIN_LEFT = 'marginLeft';
private const MARGIN_RIGHT = 'marginRight';
private const LANDSCAPE = 'landscape';
private const GOOGLE_CHROME_RPCC_BUFFER_SIZE = 'googleChromeRpccBufferSize';

/** @var float|null */
private $waitDelay;
Expand Down Expand Up @@ -47,6 +48,9 @@ abstract class ChromeRequest extends Request implements GotenbergRequestInterfac
/** @var bool */
private $landscape;

/** @var int|null */
private $googleChromeRpccBufferSize;

/**
* @return array<string,mixed>
*/
Expand Down Expand Up @@ -74,6 +78,9 @@ public function getFormValues(): array
if ($this->marginRight !== null) {
$values[self::MARGIN_RIGHT] = $this->marginRight;
}
if ($this->googleChromeRpccBufferSize !== null) {
$values[self::GOOGLE_CHROME_RPCC_BUFFER_SIZE] = $this->googleChromeRpccBufferSize;
}
$values[self::LANDSCAPE] = $this->landscape;

return $values;
Expand Down Expand Up @@ -174,4 +181,9 @@ public function setLandscape(bool $landscape): void
{
$this->landscape = $landscape;
}

public function setGoogleChromeRpccBufferSize(?int $googleChromeRpccBufferSize): void
{
$this->googleChromeRpccBufferSize = $googleChromeRpccBufferSize;
}
}
3 changes: 3 additions & 0 deletions tests/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ private function createHTMLRequest(): HTMLRequest
$request->setAssets($assets);
$request->setPaperSize(Request::A4);
$request->setMargins(Request::NO_MARGINS);
$request->setGoogleChromeRpccBufferSize(1048576);

return $request;
}
Expand All @@ -80,6 +81,7 @@ private function createURLRequest(): URLRequest
$request->setFooter($footer);
$request->setPaperSize(Request::A4);
$request->setMargins(Request::NO_MARGINS);
$request->setGoogleChromeRpccBufferSize(1048576);

return $request;
}
Expand Down Expand Up @@ -111,6 +113,7 @@ public function createMarkdownRequest(): MarkdownRequest
$request->setAssets($assets);
$request->setPaperSize(Request::A4);
$request->setMargins(Request::NO_MARGINS);
$request->setGoogleChromeRpccBufferSize(1048576);

return $request;
}
Expand Down