From ab475d65eeeec168dde45062672f9eb8d7af8b65 Mon Sep 17 00:00:00 2001 From: Julien Neuhart Date: Fri, 4 Oct 2019 16:19:53 +0200 Subject: [PATCH] fixing PrintToPDF: rpcc: message too large --- internal/pkg/printer/chrome.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/internal/pkg/printer/chrome.go b/internal/pkg/printer/chrome.go index aff21e75..0dc0c720 100644 --- a/internal/pkg/printer/chrome.go +++ b/internal/pkg/printer/chrome.go @@ -110,7 +110,18 @@ func (p chromePrinter) Print(destination string) error { } // connect the client to the new target. newTargetWsURL := fmt.Sprintf("ws://127.0.0.1:9222/devtools/page/%s", newTarget.TargetID) - newContextConn, err := rpcc.DialContext(ctx, newTargetWsURL) + newContextConn, err := rpcc.DialContext( + ctx, + newTargetWsURL, + /* + see: + https://github.com/thecodingmachine/gotenberg/issues/108 + https://github.com/mafredri/cdp/issues/4 + https://github.com/ChromeDevTools/devtools-protocol/issues/24 + */ + rpcc.WithWriteBufferSize(1024*1024), + rpcc.WithCompression(), + ) if err != nil { return err }