View Single Post
Old 02-26-2004, 06:12 PM   #1 (permalink)
bogosj13
Upright
 
[Java] Getting page count of a PDF

I'm currently working on a project that requires i get the page count of some PDFs, and this part of the system is written in Java. I've been trying to figure this out for a few days, and I've only come up with two options:
[list=1][*]I've written a Java class that opens PDFs using java.io.RandomAccessFile to parse though the PDF to determine the page count (had to read the PDF spec). I don't really trust this because, well, I wrote it.[*]Use Visual Basic to create an ActiveX DLL. Using VB, I can create an Acrobat document object and query the page count with Adobe's libraries. To integrate this DLL, I'd create a C DLL using gcc that links to the DLL that can be called via-JNI. That seems a bit complex.[/list=1]

The best option would be a Java library from Adobe, or a method to determine the page count from a PDF directly in C. Anyone have any suggestions?
bogosj13 is offline  
 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46