1

I wrote a simple java program to get the page number of a PDF document. This works for most of my documents, but it does not work for this one:

http://web.itu.edu.tr/~pazarci/rtv/TEK_Digital%20Video%20Measurements_25W_14700_3.pdf

The snippet of the code is below:

    document = PDDocument.load(docPath);
    System.out.println( docPath + ": " + document.getNumberOfPages() + " pages");

in which docPath points to the local path of this document.

The program then halts here. It does not exit and does not print any error message. It just stops at PDDocument.load() and does not continue.

fanchyna
  • 2,623
  • 7
  • 36
  • 38

1 Answers1

2

I've had the same problem, so I've opened an issue to the PDFBox crew using the PDF you mentioned. It's located on https://issues.apache.org/jira/browse/PDFBOX-1726.

They advised me to use the PDDocument.loadNoSeq() instead of PDDocument.load(). It worked for me!

Try this and let us know!