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

Commit

Permalink
adding googleChromeRpccBufferSize (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
gulien authored Oct 7, 2019
1 parent 195bf7d commit 44e0369
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
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

0 comments on commit 44e0369

Please sign in to comment.