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 MAGNIFICATION_FIT_ACTUAL
           
static String MAGNIFICATION_FIT_HEIGHT
           
static String MAGNIFICATION_FIT_PAGE
           
static String MAGNIFICATION_FIT_VISIBLE
           
static String MAGNIFICATION_FIT_WIDTH
           
static String PAGELAYOUT_ONECOLUMN
           
static String PAGELAYOUT_SINGLEPAGE
           
static String PAGELAYOUT_TWOCOLUMNLEFT
           
static String PAGELAYOUT_TWOPAGELEFT
           
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()
          Returns a list of embedded files, if any, in the document.
 File getFile()
          Deprecated. Use getSource() instead
 String getFileModifiedID()
          Return the PDF document's modified ID.
 String getFileName()
          Deprecated. Use getSource() instead.
 String getFileOriginalID()
          Return the PDF document's original ID.
 int getInitialPage()
          Returns the value saved as the initial page to be viewed when the document is opened.
 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.
 String getMagnification()
          Returns the magnification value of the OpenAction key.
 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 getPageLayout()
          Returns the value of the page layout key for this document.
 String getPageMode()
          Returns the value of the page mode viewer preference in the document.
 PDFSource getPDFSource()
          Returns an object representing the source of the PDF content.
 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

MAGNIFICATION_FIT_WIDTH

public static final String MAGNIFICATION_FIT_WIDTH
See Also:
Constant Field Values

MAGNIFICATION_FIT_VISIBLE

public static final String MAGNIFICATION_FIT_VISIBLE
See Also:
Constant Field Values

MAGNIFICATION_FIT_HEIGHT

public static final String MAGNIFICATION_FIT_HEIGHT
See Also:
Constant Field Values

MAGNIFICATION_FIT_PAGE

public static final String MAGNIFICATION_FIT_PAGE
See Also:
Constant Field Values

MAGNIFICATION_FIT_ACTUAL

public static final String MAGNIFICATION_FIT_ACTUAL
See Also:
Constant Field Values

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

PAGELAYOUT_SINGLEPAGE

public static final String PAGELAYOUT_SINGLEPAGE
See Also:
Constant Field Values

PAGELAYOUT_ONECOLUMN

public static final String PAGELAYOUT_ONECOLUMN
See Also:
Constant Field Values

PAGELAYOUT_TWOCOLUMNLEFT

public static final String PAGELAYOUT_TWOCOLUMNLEFT
See Also:
Constant Field Values

PAGELAYOUT_TWOPAGELEFT

public static final String PAGELAYOUT_TWOPAGELEFT
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.


getMagnification

public String getMagnification()
Returns the magnification value of the OpenAction key. This value is used to set the initial magnification of a document. This value can null, the percentage value of the magnification as a double converted to a string, or one of the following:
IPDFDocument.DEFAULT: Use default magnification.
IPDFDocument.MAGNIFICATION_FIT_WIDTH: Display with the page magnified just enough to fit the entire width of the page within the window.
IPDFDocument.MAGNIFICATION_FIT_VISIBLE: Display with the page magnified just enough to fit the entire width of its bounding box within the window.
IPDFDocument.MAGNIFICATION_FIT_HEIGHT: Display with the page magnified just enough to fit the entire height of the page within the window.
IPDFDocument.MAGNIFICATION_FIT_PAGE: Display with the page magnified just enough to fit the entire page within the window both horizontally and vertically .
IPDFDocument.MAGNIFICATION_FIT_ACTUAL: Display the page with 100% magnification.


getPageLayout

public String getPageLayout()
Returns the value of the page layout key for this document. This determines the layout of the page when initially opened. This value will be null or one of:
IPDFDocument.PAGELAYOUT_SINGLEPAGE: Display one page at a time.
IPDFDocument.PAGELAYOUT_ONECOLUMN: Display the page in one column (single page continuous).
IPDFDocument.PAGELAYOUT_TWOCOLUMNLEFT: Display the page in two columns (two facing continuous).
IPDFDocuemnt.PAGELAYOUT_TWOPAGELEFT: Display two pages at a time (two facing).


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()
Returns a list of embedded files, if any, in the document. The list is a vector of @see com.qoppa.pdf.IEmbeddedFile.

Returns:
The list of embedded files.

getFile

public File getFile()
Deprecated. Use getSource() instead

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.

getPDFSource

public PDFSource getPDFSource()
Returns an object representing the source of the PDF content. The object can be one of the standard implementations in the com.qoppa.pdf.source package or it can be a custom implementation of the interface.

Returns:
The object that has information about the source of the PDF content.

getFileName

public String getFileName()
Deprecated. Use getSource() instead.

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

getInitialPage

public int getInitialPage()
Returns the value saved as the initial page to be viewed when the document is opened. This value will be 0 for the first page.