Skip to content
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

Feature Request: Add a way to compress final pdf size #359

Open
spointecker opened this issue Sep 21, 2021 · 7 comments
Open

Feature Request: Add a way to compress final pdf size #359

spointecker opened this issue Sep 21, 2021 · 7 comments
Labels
enhancement New feature or request pdf-engines

Comments

@spointecker
Copy link

The currently generated pdfs look great but could be smaller in size.

If there would be an option/setting to choose the quality (1-100) for the pdf output that would be great.

@gulien gulien added enhancement New feature or request pdf-engines labels Sep 21, 2021
@axelvugts
Copy link

I second this! A PDF with 3 photos in it (3x 2MB JPEGs) is 32MB now, which is just a little much

@janswist
Copy link

janswist commented Oct 8, 2022

Also interested in this!

@kisamoto
Copy link

kisamoto commented Feb 3, 2023

I don't know how to implement this in gotenberg unfortunately but for those who find this and need smaller pdfs look at using the ps2pdf tool on them in a second step.

ps2pdf input.pdf output.pdf has proven to dramatically shrink file sizes for me.

@gulien
Copy link
Collaborator

gulien commented Feb 6, 2023

@kisamoto ps2pdf seems to use Ghostscript , which is, alas, not compatible with the Gotenberg license.

@janswist
Copy link

It's kinda interesting to see that many people need it, but somehow there is no JS native solution

@a-ayala
Copy link

a-ayala commented Feb 23, 2023

Does anyone have any recommendations on working optimally with images and the chromium module in Gotenberg?

Similar to @axelvugts I'm rendering a couple of images in my PDF, around 5mb each and the resulting file size is around 12mb. At the moment I'm passing them as file streams.

Is it just the case that we need to compress them before sending them to Gotenberg, and then compress the resulting pdf file again on the way out. Or is there something else we can do?

I wasn't sure if the issue is not with the images themselves but perhaps the options I'm using, currently all defaults.

@WillCohenInfotrack
Copy link

I think its related to Tagged PDFs - Here is PR #818

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request pdf-engines
Projects
None yet
Development

No branches or pull requests

7 participants