Results 1 to 6 of 6
Thread: Problem with PDFBox loading
- 06-07-2011, 04:33 AM #1
Member
- Join Date
- Jun 2011
- Posts
- 4
- Rep Power
- 0
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.
- 06-07-2011, 04:50 AM #2
Member
- Join Date
- Jun 2011
- Posts
- 4
- Rep Power
- 0
I opened up the PDF properties and noticed that there was no title or author set. I don't imagine that is the issue, but thought I'd mention it.
- 06-07-2011, 09:33 AM #3
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
"errors are happening"
What errors?
- 06-07-2011, 09:45 AM #4
Member
- Join Date
- Jun 2011
- Posts
- 4
- Rep Power
- 0
Sorry, should have been more explicit. It's not an error or an exception, just that the page count returns 0 when it should be 136.
- 06-07-2011, 10:17 AM #5
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
What does getNumberOfPages() give you?
Not via the document catalog.
- 06-07-2011, 11:47 PM #6
Member
- Join Date
- Jun 2011
- Posts
- 4
- Rep Power
- 0
Similar Threads
-
Problem with loading driver
By b01g in forum New To JavaReplies: 7Last Post: 07-15-2011, 06:41 PM -
Image Loading Problem
By vimalaranjan in forum Java 2DReplies: 1Last Post: 05-05-2011, 09:04 PM -
PDFBox: Problem with converting pdf page into image
By artfhc in forum Advanced JavaReplies: 1Last Post: 01-03-2011, 07:37 PM -
Problem loading an Image
By onesixtyfourth in forum Java 2DReplies: 1Last Post: 10-17-2010, 11:32 AM -
Problem with loading image
By m00nchile in forum New To JavaReplies: 5Last Post: 05-25-2010, 01:34 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks