Hi all,
no problem here, just a matter of discussion.
I just downloaded an e-book (which is currently offered for free via the how-to-geek newsletter) from here and the downloaded pdf files weighs in at 31,0 MB.
To save some disk space for archiving purposes I tend to compress pdf files of a similar size.
Well, to my astonishment the command I used didn“t make it smaller. It even grew a bit in size: 31.5 MB.
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/prepress -dNOPAUSE -dQUIET -dBATCH -sOutputFile=compressed_PDF_file.pdf w_wile540.pdf
.
So I reverted to another ghostscript command I used to run in the past when merging 2 pdf files:
gs -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=combine.pdf -dBATCH w_wile540.pdf
I guess I wouldnĀ“t have needed the āBATCHā part as there was nothing to merge. I applied it anyway, just out of laziness. I guess it didnĀ“t hurt.
Now the result was much better indeed:
The resulting file was only 22.8 MB in size. Much better now.
Out of interest I took a look at the three variants:
ll combine.pdf w_wile540.pdf compressed_PDF_file.pdf
-rw-rw-r-- 1 rosika rosika 22M Mai 5 15:54 combine.pdf # result of the second command
-rw-rw-r-- 1 rosika rosika 31M Mai 5 15:51 compressed_PDF_file.pdf # result of the first command
-rw-rw-r-- 1 rosika rosika 30M Mai 5 15:44 w_wile540.pdf # original file
and:
file combine.pdf w_wile540.pdf compressed_PDF_file.pdf
combine.pdf: PDF document, version 1.7
compressed_PDF_file.pdf: PDF document, version 1.4
w_wile540.pdf: PDF document, version 1.7 (zip deflate encoded)
Interesting. The original file is marked as āzip deflate encodedā. The first command changed the PDF version to 1.4. The second command just stated version 1.7.
Any ideas why the first command didn“t actually make the pdf smaller
Thanks for your opinions and many greetings from Rosika