pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Santiago Cardoso Geller <cardosogel...@gmail.com>
Subject pdfbox Encrypt from command line
Date Fri, 19 Jun 2015 20:27:34 GMT
Hi! I was trying to Encrypt a pdf from the command line by executing the
following:

java -jar pdfbox-app-1.8.9.jar Encrypt -U 12345 -O 12345 test.pdf
test-encrypted.pdf

But I get the following error:
Encrypt failed with the following exception:
java.io.IOException: Error: Expected a long type at offset 7321, instead
got '?'
        at
org.apache.pdfbox.pdfparser.BaseParser.readLong(BaseParser.java:1695)
        at
org.apache.pdfbox.pdfparser.BaseParser.readObjectNumber(BaseParser.java:1623)
        at
org.apache.pdfbox.pdfparser.PDFParser.parseXrefTable(PDFParser.java:818)
        at
org.apache.pdfbox.pdfparser.PDFParser.parseObject(PDFParser.java:540)
        at org.apache.pdfbox.pdfparser.PDFParser.parse(PDFParser.java:203)
        at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:1220)
        at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:1187)
        at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:1112)
        at org.apache.pdfbox.Encrypt.encrypt(Encrypt.java:158)
        at org.apache.pdfbox.Encrypt.main(Encrypt.java:53)
        at org.apache.pdfbox.PDFBox.main(PDFBox.java:54)

I only downloaded pdfbox-app-1.8.9.jar file. Is it required something else?

Thanks,
Santiago

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message