com.qoppa.pdf.dom
Interface IPDFDocument

All Superinterfaces:
Printable
All Known Implementing Classes:
AbstractPDFDocument, PDFDocument

public interface IPDFDocument
extends Printable

Object representation of a PDF document. This interface provides information about the document and its pages.

Author:
Qoppa Software

Field Summary
static String PAGEMODE_FULLSCREEN
           
static String PAGEMODE_USEATTACHMENTS
           
static String PAGEMODE_USENONE
           
static String PAGEMODE_USEOC
           
static String PAGEMODE_USEOUTLINES
           
static String PAGEMODE_USETHUMBS
           
 
Fields inherited from interface java.awt.print.Printable
NO_SUCH_PAGE, PAGE_EXISTS
 
Method Summary
 void addDocumentListener(IDocumentListener listener)
          Internal method to keep track of document events.
 AcroForm getAcroForm()
          Returns the AcroForm in this document.
 DocumentInfo getDocumentInfo()
          Returns a DocumentInfo object containing the PDF standard document info if present.
 Vector getEmbeddedFiles()
           
 File getFile()
          Returns the file for the current pdf document.
 String getFileModifiedID()
          Return the PDF document's modified ID.
 String getFileName()
          Returns the file name that this document was loaded from.
 String getFileOriginalID()
          Return the PDF document's original ID.
 IPDFPage getIPage(int pageIndex)
          Returns an object that implements IPDFPage given the page number.
 Layer getLayer(int layerIndex)
          Returns a particular PDF layer given its index.
 int getLayerCount()
          Returns the number of PDF layers in this document.
 Pageable getPageable(PrinterJob pJob)
          Returns an object that implements Pageable for this PDF document.
 int getPageCount()
          Returns the number of pages in this document.
 String getPageMode()
          Returns the value of the page mode viewer preference in the document.
 PDFPermissions getPermissions()
          Returns the Permissions object for this document.
 PrintSettings getPrintSettings()
          Get the current PrintSettings object.
 Bookmark getRootBookmark()
          Returns the bookmark tree for this document.
 String getText()
          Returns the text content of the entire document, as a String
 String getText(int pageIndex)
          Returns the text content of this page as a String.
 void print(PrintSettings printSettings)
          Prints this PDF document.
 void removeDocumentListener(IDocumentListener listener)
          Internal method to keep track of document events.
 void setPrintSettings(PrintSettings printSettings)
          Set the PrintSettings to be used on the next printout.
 
Methods inherited from interface java.awt.print.Printable
print
 

Field Detail

PAGEMODE_USENONE

public static final String PAGEMODE_USENONE
See Also:
Constant Field Values

PAGEMODE_USEOUTLINES

public static final String PAGEMODE_USEOUTLINES
See Also:
Constant Field Values

PAGEMODE_USETHUMBS

public static final String PAGEMODE_USETHUMBS
See Also:
Constant Field Values

PAGEMODE_FULLSCREEN

public static final String PAGEMODE_FULLSCREEN
See Also:
Constant Field Values

PAGEMODE_USEOC

public static final String PAGEMODE_USEOC
See Also:
Constant Field Values

PAGEMODE_USEATTACHMENTS

public static final String PAGEMODE_USEATTACHMENTS
See Also:
Constant Field Values
Method Detail

getPageCount

public int getPageCount()
Returns the number of pages in this document.


getPageMode

public String getPageMode()
Returns the value of the page mode viewer preference in the document. The page mode is used when the document is opened in a PDF viewer. This value can either be null or one of:
PAGEMODE_USENONE: Neither document outline nor thumbnail images are visible.
PAGEMODE_USEOUTLINES: Document outline visible.
PAGEMODE_USETHUMBS: Thumbnail images visible.
PAGEMODE_FULLSCREEN: Full screen mode, with no menu bar, window controls, or any other window visible.
PAGEMODE_USEOC: Optional content group panel visible (PDF 1.5 and up).
PAGEMODE_USEATTACHMENTS: Attachments panel visible (PDF 1.6 and up).


getPermissions

public PDFPermissions getPermissions()
Returns the Permissions object for this document.


getIPage

public IPDFPage getIPage(int pageIndex)
Returns an object that implements IPDFPage given the page number.

Parameters:
pageIndex - Index of the page to return.

getLayerCount

public int getLayerCount()
Returns the number of PDF layers in this document.

Returns:
Number of layers in the document.

getLayer

public Layer getLayer(int layerIndex)
Returns a particular PDF layer given its index.

Returns:
A reference to the PDF layer.

addDocumentListener

public void addDocumentListener(IDocumentListener listener)
Internal method to keep track of document events.


removeDocumentListener

public void removeDocumentListener(IDocumentListener listener)
Internal method to keep track of document events.


print

public void print(PrintSettings printSettings)
           throws PDFPermissionException,
                  PrinterException
Prints this PDF document. This method will prompt the user with the printer dialog and then print the document.

If more control is desired when printing, this object implements both the Pageable and the Printable interfaces. The calling application can create its own PrinterJob and then use this object as a parameter in the setPageable or setPrintable methods.

Parameters:
printSettings - Print job settings. Use this object to tell jPDFProcess how to print the document. If null, the library will print using default settings.
Throws:
PDFPermissionException
PrinterException

getEmbeddedFiles

public Vector getEmbeddedFiles()

getFile

public File getFile()
Returns the file for the current pdf document. If the document was loaded from a URL or from an InputStream, this will return null.

Returns:
The file for the current pdf document.

getFileName

public String getFileName()
Returns the file name that this document was loaded from. If the document was loaded from a URL or from an InputStream, this will return null.

Returns:
The file name that the document was loaded from.

getFileOriginalID

public String getFileOriginalID()
Return the PDF document's original ID. This is a quasi-unique id generated by the software that created the document that can be used to reference documents.

Returns:
The document's original ID.

getFileModifiedID

public String getFileModifiedID()
Return the PDF document's modified ID. This is a quasi-unique id that should be generated by any program that modifies the document.

Returns:
The document's modified ID.

getDocumentInfo

public DocumentInfo getDocumentInfo()
Returns a DocumentInfo object containing the PDF standard document info if present.

Returns:
Document info fields

getRootBookmark

public Bookmark getRootBookmark()
Returns the bookmark tree for this document.

Returns:
The root of the bookmark tree.

getPrintSettings

public PrintSettings getPrintSettings()
Get the current PrintSettings object.


setPrintSettings

public void setPrintSettings(PrintSettings printSettings)
Set the PrintSettings to be used on the next printout.

Parameters:
printSettings - Settings to use on the next printout.

getAcroForm

public AcroForm getAcroForm()
Returns the AcroForm in this document. Returns null if the document has no fields.

Returns:
AcroForm The AcroForm object for this document.

getPageable

public Pageable getPageable(PrinterJob pJob)
Returns an object that implements Pageable for this PDF document. The method takes a PrinterJob object as a parameter because information about the printer is needed in order to fulfill the Pageable interface properly.

Parameters:
pJob - PrinterJob object where the Pageable will be used.
Returns:
Object that implements the Pageable interface.

getText

public String getText()
               throws PDFException
Returns the text content of the entire document, as a String

Returns:
The text content of the document.
Throws:
PDFException

getText

public String getText(int pageIndex)
               throws PDFException
Returns the text content of this page as a String.

Parameters:
pageIndex - The index of the page to get the text for.
Returns:
The text content of this page.
Throws:
PDFException