New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PrintToPDF: rpcc: message too large #108
Comments
Thank you for this well written issue 😄 I need to dig in to understand what's going on. Hopefully I'll be able to provide a fix in version |
@gulien I think this comes from https://github.com/mafredri/cdp/blob/2a28a12ac3f505882ed2648f5a1499ff42d0141b/rpcc/conn.go#L203, where |
Same here , any idea how to increase the buffer ? |
According to chrome dev issue ChromeDevTools/devtools-protocol#24., the buffer has been increased from 1MB to 100 MB. I hope gotenberg 6.0 will get this update too @gulien any plan ? :) |
Thank you both for your help. I've increased the buffer size to 1MB and enabled compression (see #121). I think there is no need to increase even further the buffer size because 1MB compressed is BIG (non-compressed 1MB of text looks like this: https://gist.github.com/khaykov/a6105154becce4c0530da38e723c2330 - I tested an header with this content with success 🎉). If ok for you, I'll merge #121 and tag a new |
@gulien Thanks for quickly resolving this problem! |
@PrzemoRevolve actually we cannot embed Javascript and external resources (fonts, images etc.). The only way to put some images is by using a Still, it could be interesting to provide a way to increase this buffer size, either via an environment variable or via a form field. |
@gulien Yes, that's exactly what I meant - as you said only way to do this is with embedding a |
I've added an env var See #121 |
@gulien Thank you! This perfectly solves my case 😁 |
Hello!
I've noticed that when sending a header/footer html files, there seems to be a hard size limit for them.
In case of text this isn't a problem, but I when wanted to embed an inline png as base64 encoded, this caused me a lot of trouble. I ended up converting the PNG to SVG and optimizing it below the limit.
I can't see any entry in the docs that would say how to increase that limit.
Expected Behavior
Either:
Current Behavior
PDF generation fails when header file is too big, with message: "printing page to PDF: cdp.Page: PrintToPDF: rpcc: message too large (increase write buffer size or enable compression)"
Steps to Reproduce (for bugs)
I've created a small reproduction repo with steps & files to reproduce: https://github.com/PrzemoRevolve/gotenberg-header-repro
My Environment
docker run --rm -p 3000:3000 thecodingmachine/gotenberg:5
The text was updated successfully, but these errors were encountered: