jhove
jhove copied to clipboard
Report a more informative error message for encrypted PDFs
Jhove's output could be more informative for PDFs that use any kind of encryption. Currently JHOVE reports the following error message in this case (tested with Jhove 1.24.1, 2020-03-16):
ErrorMessage: Compression method is invalid or unknown to JHOVE
This is not particularly helpful, especially because it provides no clue whatsoever about encryption being the culprit. Perhaps the error message could be changed to something more informative that at least mentions the encryption?
Example files:
- https://github.com/openpreserve/format-corpus/raw/master/pdfCabinetOfHorrors/encryption_noprinting.pdf
- https://github.com/openpreserve/format-corpus/raw/master/pdfCabinetOfHorrors/encryption_nocopy.pdf
- https://github.com/openpreserve/format-corpus/raw/master/pdfCabinetOfHorrors/encryption_notextaccess.pdf
- https://github.com/openpreserve/format-corpus/raw/master/pdfCabinetOfHorrors/encryption_openpassword.pdf
I strongly support this and can supply quite a few real-life examples.
We recently ran into a similar problem, and our JHOVE users couldn't understand the problem because of the arbitrary message JHOVE returned. So I also support this issue.
I just stumbled across this issue again. In addition to the confusing message itself, the fact hat JHOVE exits with an error (instead of parsing the file) also doesn't seem quite the right behavior (except for PDFs with an "open password", which cannot be parsed at all without a password). For all other cases (printing, copying and text access restrictions) other tools such as VeraPDF are perfectly capable of parsing PDFs with those restrictions. And since the PDF spec allows these restrictions, they shouldn't result in a "Not well-formed" validation outcome.
Seems JHOVE 1.28 changes fixed this, so closing this issue now.
Re-opening as JHOVE still reports this error for some PDFs with security-related features. Examples:
Additional check with VeraPDF confirms both files contain security features.