org.umber.crucible.pdf
Class PdfFactory

java.lang.Object
  extended byorg.umber.crucible.pdf.PdfFactory

public class PdfFactory
extends java.lang.Object


Method Summary
static IPdfDocument createDocument()
          Creates a Crucible wrapper around a PDF document.
static IPdfDocument createGnuJpdfDocument()
          Creates a Crucible wrapper around a GNU jPDF document.
static IPdfDocument createITextDocument()
          Creates a Crucible wrapper around an iText document.
static IPdfDocument createPdfBoxDocument()
          Creates a Crucible wrapper around a PdfBox document.
static boolean foundGnuJpdf()
          Determines if the GNU jPDF library is available on the CLASSPATH.
static boolean foundIText()
          Determines if the iText library is available on the CLASSPATH.
static boolean foundPdfBox()
          Determines if the PdfBox library is available on the CLASSPATH.
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

foundGnuJpdf

public static boolean foundGnuJpdf()
Determines if the GNU jPDF library is available on the CLASSPATH.

Returns:
true if available

foundIText

public static boolean foundIText()
Determines if the iText library is available on the CLASSPATH.

Returns:
true if available

foundPdfBox

public static boolean foundPdfBox()
Determines if the PdfBox library is available on the CLASSPATH.

Returns:
true if available

createGnuJpdfDocument

public static IPdfDocument createGnuJpdfDocument()
                                          throws CruciblePdfException
Creates a Crucible wrapper around a GNU jPDF document.

Returns:
GNU jPDF document
Throws:
CruciblePdfException - if GNU jPDF is not on CLASSPATH

createITextDocument

public static IPdfDocument createITextDocument()
                                        throws CruciblePdfException
Creates a Crucible wrapper around an iText document.

Returns:
iText document
Throws:
CruciblePdfException - if iText is not on CLASSPATH

createPdfBoxDocument

public static IPdfDocument createPdfBoxDocument()
                                         throws CruciblePdfException
Creates a Crucible wrapper around a PdfBox document.

Returns:
PdfBox document
Throws:
CruciblePdfException - if PdfBox is not on CLASSPATH

createDocument

public static IPdfDocument createDocument()
                                   throws CruciblePdfException
Creates a Crucible wrapper around a PDF document. First attempts to use iText, then PdfBox, then GNU jPDF. Since GNU jPDF is bundled with Crucible, this method should never fail.

Returns:
GNU jPDF document
Throws:
CruciblePdfException - if no PDF libraries are on CLASSPATH

main

public static void main(java.lang.String[] args)