You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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.
How do I supply a password for a password protected PDF?
I am getting this error:
The text was updated successfully, but these errors were encountered: