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

The supplied password does not match either the owner or user password in the document. #26

Open
tetherit opened this issue Jan 27, 2015 · 1 comment

Comments

@tetherit
Copy link

How do I supply a password for a password protected PDF?

I am getting this error:

*** Reading ./data/attachments/dasd.pdf
INFO - Document is encrypted
[Fatal Error] :1:1: Content is not allowed in prolog.
Exception in thread "main" org.apache.tika.exception.TikaException: Unable to extract PDF content
    at org.apache.tika.parser.pdf.PDF2XHTML.process(PDF2XHTML.java:146)
    at org.apache.tika.parser.pdf.PDFParser.parse(PDFParser.java:159)
    at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:244)
    at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:244)
    at org.apache.tika.parser.AutoDetectParser.parse(AutoDetectParser.java:121)
    at org.apache.tika.cli.TikaCLI$OutputType.process(TikaCLI.java:143)
    at org.apache.tika.cli.TikaCLI.process(TikaCLI.java:407)
    at org.apache.tika.cli.TikaCLI.main(TikaCLI.java:116)
Caused by: org.apache.pdfbox.exceptions.WrappedIOException: Error decrypting document, details: 
    at org.apache.pdfbox.util.PDFTextStripper.writeText(PDFTextStripper.java:341)
    at org.apache.tika.parser.pdf.PDF2XHTML.process(PDF2XHTML.java:130)
    ... 7 more
Caused by: org.apache.pdfbox.exceptions.CryptographyException: Error: The supplied password does not match either the owner or user password in the document.
    at org.apache.pdfbox.pdmodel.encryption.StandardSecurityHandler.prepareForDecryption(StandardSecurityHandler.java:264)
    at org.apache.pdfbox.pdmodel.encryption.StandardSecurityHandler.decryptDocument(StandardSecurityHandler.java:156)
    at org.apache.pdfbox.pdmodel.PDDocument.openProtection(PDDocument.java:1597)
    at org.apache.pdfbox.pdmodel.PDDocument.decrypt(PDDocument.java:943)
    at org.apache.pdfbox.util.PDFTextStripper.writeText(PDFTextStripper.java:337)
    ... 8 more
@nruth
Copy link

nruth commented Jan 13, 2016

Going by https://github.com/Erol/yomu/blob/master/lib/yomu.rb#L39 it looks like this isn't supported.
If Tika supports PDF passwords as a command line option then it should be fairly easy to add as an option for the client-read method, but I don't know how it'd work for server-read.

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

1 participant