Problem with PDFBox loading
I have written a very simple PDF parser, and it works just fine on the PDF files I have used for testing. I installed it at the client and it still works fine, but they have started using it against their PDF files, and errors are happening. The files are larger and more graphically intense, but still regular old PDF files. My tool doesn't strip text or do anything special, it just grabs whatever pages they request and creates a new PDF file. The files they are using are larger, but not excessively large, in the area of 6k.
I am using the following code:
// grab the file
File input = new File(fpath);
// load the PDF as a PDDocument -- This does NOT throw an error
PDDocument original = PDDocument.load(input);
// This line prints out that the file exists
System.out.println("exists? " + input.exists());
// This returns Total number of pages: 0
// It should return 136
System.out.println("Total number of pages: " + original.getDocumentCatalog().getAllPages().size() );
Any thoughts? I can't seem to find any explanations on why it is loading a valid file and not picking up the details. If I open the PDF file from that URL I can view it just fine. This is running on Solaris with iPlanet (though that shouldn't impact anything presumably) and PDFBox 1.5.
I cannot include PDF files, as they are private information. I recognize that makes this harder to troubleshoot, but I'm hoping for someone to have a similar experience that I can maybe work with.
Re: Problem with PDFBox loading
I want to write a pdf modifier as well but I can't show pdf file in my Jframe how could i do it?
Originally Posted by biguglyjim