From 8c7fdac2e467b76add2db70def3930cf56ee9fab Mon Sep 17 00:00:00 2001 From: Julien Neuhart Date: Mon, 7 Oct 2019 15:50:13 +0200 Subject: [PATCH] adding googleChromeRpccBufferSize --- Makefile | 2 +- chrome.go | 22 ++++++++++++++-------- html_test.go | 2 ++ markdown_test.go | 2 ++ url_test.go | 2 ++ 5 files changed, 21 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index b3451c8..17640b3 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ GOLANG_VERSION=1.13 -GOTENBERG_VERSION=6.0.0 +GOTENBERG_VERSION=6.0.1 VERSION=snapshot GOLANGCI_LINT_VERSION=1.19.1 diff --git a/chrome.go b/chrome.go index afe97c1..826d265 100644 --- a/chrome.go +++ b/chrome.go @@ -6,14 +6,15 @@ import ( ) const ( - waitDelay string = "waitDelay" - paperWidth string = "paperWidth" - paperHeight string = "paperHeight" - marginTop string = "marginTop" - marginBottom string = "marginBottom" - marginLeft string = "marginLeft" - marginRight string = "marginRight" - landscapeChrome string = "landscape" + waitDelay string = "waitDelay" + paperWidth string = "paperWidth" + paperHeight string = "paperHeight" + marginTop string = "marginTop" + marginBottom string = "marginBottom" + marginLeft string = "marginLeft" + marginRight string = "marginRight" + landscapeChrome string = "landscape" + googleChromeRpccBufferSize string = "googleChromeRpccBufferSize" ) // nolint: gochecknoglobals @@ -98,6 +99,11 @@ func (req *chromeRequest) Landscape(isLandscape bool) { req.values[landscapeChrome] = strconv.FormatBool(isLandscape) } +// GoogleChromeRpccBufferSize sets googleChromeRpccBufferSize form field. +func (req *chromeRequest) GoogleChromeRpccBufferSize(bufferSize int64) { + req.values[googleChromeRpccBufferSize] = strconv.FormatInt(bufferSize, 10) +} + func (req *chromeRequest) formFiles() map[string]string { files := make(map[string]string) files["header.html"] = req.headerFilePath diff --git a/html_test.go b/html_test.go index 3f5db6c..652382e 100644 --- a/html_test.go +++ b/html_test.go @@ -30,6 +30,7 @@ func TestHTML(t *testing.T) { req.PaperSize(A4) req.Margins(NormalMargins) req.Landscape(false) + req.GoogleChromeRpccBufferSize(1048576) dirPath, err := test.Rand() require.Nil(t, err) dest := fmt.Sprintf("%s/foo.pdf", dirPath) @@ -47,6 +48,7 @@ func TestHTMLWithoutHeaderFooter(t *testing.T) { req.PaperSize(A4) req.Margins(NormalMargins) req.Landscape(false) + req.GoogleChromeRpccBufferSize(1048576) dirPath, err := test.Rand() require.Nil(t, err) dest := fmt.Sprintf("%s/foo.pdf", dirPath) diff --git a/markdown_test.go b/markdown_test.go index 87fc116..40c1ce2 100644 --- a/markdown_test.go +++ b/markdown_test.go @@ -35,6 +35,7 @@ func TestMarkdown(t *testing.T) { req.PaperSize(A4) req.Margins(NormalMargins) req.Landscape(false) + req.GoogleChromeRpccBufferSize(1048576) dirPath, err := test.Rand() require.Nil(t, err) dest := fmt.Sprintf("%s/foo.pdf", dirPath) @@ -57,6 +58,7 @@ func TestMarkdownWithoutHeaderFooter(t *testing.T) { req.PaperSize(A4) req.Margins(NormalMargins) req.Landscape(false) + req.GoogleChromeRpccBufferSize(1048576) dirPath, err := test.Rand() require.Nil(t, err) dest := fmt.Sprintf("%s/foo.pdf", dirPath) diff --git a/url_test.go b/url_test.go index 1d5060c..10e511c 100644 --- a/url_test.go +++ b/url_test.go @@ -23,6 +23,7 @@ func TestURL(t *testing.T) { req.PaperSize(A4) req.Margins(NormalMargins) req.Landscape(false) + req.GoogleChromeRpccBufferSize(1048576) dirPath, err := test.Rand() require.Nil(t, err) dest := fmt.Sprintf("%s/foo.pdf", dirPath) @@ -39,6 +40,7 @@ func TestURLWithoutHeaderFooter(t *testing.T) { req.PaperSize(A4) req.Margins(NormalMargins) req.Landscape(false) + req.GoogleChromeRpccBufferSize(1048576) dirPath, err := test.Rand() require.Nil(t, err) dest := fmt.Sprintf("%s/foo.pdf", dirPath)