adams.core.io
Class JPod

java.lang.Object
  extended by adams.core.io.JPod

public class JPod
extends Object

Helper class for jPod (PDF handling).

Version:
$Revision: 4584 $
Author:
fracpete (fracpete at waikato dot ac dot nz)

Constructor Summary
JPod()
           
 
Method Summary
static void close(de.intarsys.pdf.pd.PDDocument document)
          Closes the document again.
static String extract(File file)
          Extracts all text from the specified PDF file.
static String extract(File file, Range range)
          Extracts all text from the specified PDF file.
static List<BufferedImage> extractImages(File file)
          Extracts all images from the specified PDF file.
static int getPageCount(File file)
          Determines the page count of a PDF file.
static de.intarsys.pdf.pd.PDDocument load(File file)
          Loads the specified PDF document.
static de.intarsys.pdf.pd.PDDocument load(String file)
          Loads the specified PDF document.
static boolean save(de.intarsys.pdf.pd.PDDocument doc, File file)
          Saves the PDF document under the specified filename.
static boolean save(de.intarsys.pdf.pd.PDDocument doc, String file)
          Saves the PDF document under the specified filename.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JPod

public JPod()
Method Detail

load

public static de.intarsys.pdf.pd.PDDocument load(String file)
Loads the specified PDF document.

Parameters:
file - the file to load
Returns:
the PDF document, null in case of an error

load

public static de.intarsys.pdf.pd.PDDocument load(File file)
Loads the specified PDF document.

Parameters:
file - the file to load
Returns:
the PDF document, null in case of an error

close

public static void close(de.intarsys.pdf.pd.PDDocument document)
Closes the document again.

Parameters:
document - the document to close, can be null

save

public static boolean save(de.intarsys.pdf.pd.PDDocument doc,
                           String file)
Saves the PDF document under the specified filename.

Parameters:
doc - the document to save
file - the file to save the document to
Returns:
true if successfully saved

save

public static boolean save(de.intarsys.pdf.pd.PDDocument doc,
                           File file)
Saves the PDF document under the specified filename.

Parameters:
doc - the document to save
file - the file to save the document to
Returns:
true if successfully saved

extract

public static String extract(File file)
Extracts all text from the specified PDF file.

Parameters:
file - the PDF file to extract the content from
Returns:
the extracted text, null in case of an error

extract

public static String extract(File file,
                             Range range)
Extracts all text from the specified PDF file.

Parameters:
file - the PDF file to extract the content from
range - the range of pages to extract
Returns:
the extracted text, null in case of an error

extractImages

public static List<BufferedImage> extractImages(File file)
Extracts all images from the specified PDF file.

Parameters:
file - the PDF file to extract the images from
Returns:
the extracted images, null in case of an error

getPageCount

public static int getPageCount(File file)
Determines the page count of a PDF file.

Parameters:
file - the PDF file to extract the content from
Returns:
the page count, -1 in case of an error


Copyright © 2013 University of Waikato, Hamilton, NZ. All Rights Reserved.