Hi Leonard,
as Gilad already said, the document is encrypted. Most of the documents can be decrypt with a default password. Just use null or a empty string to decrypt the pdf.

Put this lines after PDDocument.load(...)

if (doc.isEncrypted()) {
  doc.decrypt("");
}

Best regards
Thomas


Zitat von Leonard Teo <[email protected]>:

Hi guys,

I'm having an issue with a specific PDF and PDFBox 1.8.1.

This is what I'm doing:
List pages = doc.getDocumentCatalog().getAllPages();
pages.size() will return 0

Here is the PDF:
https://dl.dropboxusercontent.com/u/1413139/Est_Limits_of_Civil_Government.pdf

Full Source Code:
https://gist.github.com/leonardteo/a1dec98bfd1cbe6b919d

Do you guys know what is the issue with this specific PDF that would be
causing PDFBox to think that it has 0 pages?

Thanks,

Leonard




--
Leonard Teo
Ballistiq Digital, Inc.
http://www.ballistiq.com
2001 University Street, Suite 1700
Montreal, QC H3A 2A6

Cell: 514 512 9873
Skype: leonardteo



Reply via email to