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

Thanks and comments #7

Closed
caspertone2003 opened this issue Feb 13, 2023 · 2 comments
Closed

Thanks and comments #7

caspertone2003 opened this issue Feb 13, 2023 · 2 comments

Comments

@caspertone2003
Copy link

caspertone2003 commented Feb 13, 2023

Thanks for this nice piece of sw.
I wish to comment that output seems much cleaner than ghostcript based solutions.
I believe that PDFBox based tools (I also tried PDFFlattener but I need a pure CMD based approach - with same good outcomes) provide better optimization, in the sense that for same size output resolution is better.

Just one comment. For my 1GByte pdf input I had to add -Xmx2048m otherwise the run fails.

By the way, could I ask you to have a view to https://github.com/cityssm/pdfFlattener

In my tests, for my PDFs, I get 25% smaller files with your SW than with the pdfFlattener for at my eye similar quality, but would like to know if your sw also removes any active content.

If not, could you have a view to cityssm/pdfFlattener#4
Perhaps you could contribute easily a pull request to introduce a no gui version in pdfFlattener, or perhaps to fork or create one... I would do myself, but I am really illeterate on these subjects, just a CMD user... I tried to understand PDFBox and I am really not knowing where to start...

Thanks in advance!
CT

@bnanes
Copy link
Owner

bnanes commented Feb 13, 2023

Hi @caspertone2003, glad you have found this to be useful. shrink-pdf is significantly different from cityssm/pdfFlattener, although I can see how both might reduce file size for some PDFs. The goal of shrink-pdf is to compress raster images in the document while preserving all vector elements. Anything other than image elements should not be touched. In contrast, cityssm/pdfFlattener rasterizes the entire document. The choice of which package to use should depend on what you are trying to accomplish.

@bnanes bnanes closed this as completed Feb 13, 2023
@caspertone2003
Copy link
Author

@bnanes
Thanks again.
Certainly I was a little misled in my understanding of shrink-pdf, as my starting PDF are alll images (I rasterize the source PDFs using convert from Imagemagick), so, for that case, I achive the same outcome with both tools - yours is more convinient due to it being just command line.
After all I learnt, I can now skip the imagemagick conversion if I use directly PDFFlattener. Unfortunately it forces to use a gui and I cannot authomate the chaintool.
So, I will continue using convert+shrink, that I can authomate.
Thanks again for the tool and the patience with me.
CT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants