![]() |
![]() |
#1 (permalink) |
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? |
![]() |
![]() |
#2 (permalink) |
WARNING: FLAMMABLE
Location: Ask Acetylene
|
http://www.lowagie.com/iText/
Might have something useful? Or http://big.faceless.org/products/pdf/ or http://www.etymon.com/epub.html Truly google is your friend. http://www.google.com/search?q=java+...UTF-8&oe=UTF-8 Have a blast.
__________________
"It better be funny" ![]() |
![]() |
Tags |
count, java, page, pdf |
|
|