| Issue 51: | Add decryption support | |
| 1 person starred this issue and may be notified of changes. | Back to list |
Hi, I checked out the latest revision (r167) of pdfsizeopt on my Debian squeeze system and ran it on the attached file `test.pdf'. This file is *not* protected. $ python pdfsizeopt.py --use-multivalent=false test.pdf info: This is pdfsizeopt.py r166 size=279220. info: loading PDF from: test.pdf info: loaded PDF of 313456 bytes info: separated to 131 objs + xref + trailer info: found 0 Type1 fonts loaded info: found 0 Type1C fonts loaded info: eliminated 21 duplicate objs info: eliminated 3 unused objs in 3 classes info: saving PDF with 107 objs to: test.pso.pdf info: generated 303933 bytes (97%) The output file however seems to be corrupted; various programs either cannot show it or demand some password: - pdfinfo, xpdf (using libpoppler) - GNOME evince (using libcairo) Can you please have a look into this case. Please let me know if some further information is needed. Thanks a lot. Mathias
Aug 25, 2011
> Please note that the PDF file format supports encryption without a (user) password, so viewer software can decrypt it without asking for a password. This is what happens with the attached test.pdf . Sorry for my early claim that it's not "protected". I should have been able to become aware easily of the opposite using e.g. pdfinfo and not merely a pdf viewer. Thanks you for your quick reaction and the bypass solution using qpdf in the new revision. Please note, that I deleted the attached file test.pdf from my first post. Anyway it can be downloaded freely from http://www.swp-berlin.org/de/produkte/swp-studien-de/swp-studien-detail/article/private_militaerfirmen_im_voelkerrecht.html
Apr 2, 2012
(No comment was entered for this change.)
Summary:
Add decryption support
Jul 2, 2012
Many users would find this useful, especially if it was automated manual decryption with qpdf.exe would not be necessary. There are many external tools to decrypt PDFs: * qpdf --decrypt (doesn't change anything else) * Multivalent tool.pdf.Compress * gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=unencrypted.pdf -c .setpdfwrite -f encrypted.pdf , but some of them (e.g. Ghostscript and tool.pdf.Compress) do extra, unwanted transformations as well. We could also integrate decryption to pdfsizeopt, but it may be a bit slow. Multivalent and qpdf are both able to decrypt PDFs. Maybe addn
Labels:
-Priority-Medium Priority-High
Jan 28, 2014
qpdf --decrypt removed pdf-pseudo-encryption without unwanted changes in all of my test cases. Multivalent and Ghostscript had unwanted side-effects and mutool often created damaged PDF files. So I stick with qpdf.
Jan 28, 2014
Thanks for the feedback. The newest version of pdfsizeopt recommends using qpdf --decrypt if needed. Does it show this message for your encrypted PDF? It wouldn't be too hard to exectend pdfsizeopt to call qpdf --decrypt automatically by default (could be disabled by --use-qpdf-decrypt=no). Would you like to have this feature? |
Labels: -Type-Defect Type-Enhancement