pts/pdfsizeopt

using CPDF before or after PSO

maadjordan opened this issue · 16 comments

referring to pdf tool called CPDF at https://github.com/johnwhitington/cpdf-source
I've tested the following command line:
cpdf -compress -no-preserve-objstm -remove-duplicate-streams -fix-prince -remove-duplicate-fonts -remove-metadata -no-embed-font -squeeze "input" -o "output"

I got some saving occasionally by using it before PSO but using it after will rarely make any same.

pts commented

Thank you for this feedback!

I'm closing thus issue because I can't see any immediate action which could be taken to improve pdfsizeopt. Feel free to reopen it if you have specific recommendations.

BTW Multivalent can be found here
https://github.com/tsibley/multivalent-tools

additional benefit of using CPDF it can repair and reconstruct bad or damaged streams that resulted into pdfsizeopt make a succesful optimization instead of generating error.

@maadjordan say> cpdf ...

Very useful info!

Also the following:
1- Qpdf has reconstruction abilities.. to be considered too ..
2- using cpdf for optimizing and compressing prior PSO will reduce resulted saving.

@maadjordan say> Qpdf has reconstruction abilities

Details in the studio, please.

studio ?

@maadjordan say> studio ?

This is a figurative expression, an example is expected.

i am still testing as i am getting different results

sample file: http://www.arvindguptatoys.com/arvindgupta/paper-polyhedra.pdf
Original 2,626,880 bytes
PSO 342,473 bytes
CPDF 344,856 bytes
PSO+CPDF 340,916 bytes
CPDF+PDF 342,051 bytes

this file cpdf after pso is best

@maadjordan say> CPDF+PDF 342,051 bytes

Maybe CPDF+QPDF? And options QPDF?

currently using

cpdf -compress -no-preserve-objstm -remove-duplicate-streams -fix-prince -remove-duplicate-fonts -remove-metadata -no-embed-font -squeeze "%i" -o "%i.cpd"

pdfsizeopt --v=20 --use-pngout=No --use-image-optimizer=ECT --use-multivalent=YES --do-fast-bilevel-images=Yes --tmp-dir=d:\temp "%i" "%i.pso"

@maadjordan say> currently using

Not. Interested "Qpdf has reconstruction abilities".

@rbrito say> I will add more comments as soon as I have some more free time.

Good, thank.

pts commented

I modified my own copy of pdfsizeopt to never use what Péter calls "low
effort" (or something similar in the source code) and always use level 9 of
deflate.

@rbrito, please file a separate issue for this. pdfsizeopt should be able to recompress all flate streams with effort 9, and probably that should be the default.