com.qoppa.pdf.dom
Interface IPDFDocument

All Superinterfaces:
Printable
All Known Implementing Classes:
com.qoppa.pdfViewer.hiObjects.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_TWOCOLUMNRIGHT
           
static String PAGELAYOUT_TWOPAGELEFT
           
static String PAGELAYOUT_TWOPAGERIGHT
           
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.
 void addPrintListener(PrintListener printListener)
          Adds a PrintListener to the PDFDocument
 boolean containsJavaScript()
          Returns true when the PDF document contains javascript.
 AcroForm getAcroForm()
          Returns the AcroForm in this document.
 IAnnotationFactory getAnnotationFactory()
          Returns the AnnotationFactory for this document.
 DocumentInfo getDocumentInfo()
          Returns a DocumentInfo object containing the PDF standard document info if present.
 DocumentViewPrefs getDocumentViewPrefs()
          Returns a DocumentViewPrefs object containing information about the way the document is to be presented on the screen or in print.
 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 getLinearizationVersionNumber()
          Returns the linearization version number.
 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.
 AllPDFPermissions getPDFPermissions()
          Returns the AllPDFPermissions object for this document.
 PDFSource getPDFSource()
          Returns an object representing the source of the PDF content.
 PDFPermissions getPermissions()
          Deprecated. Use getPDFPermissions().getPasswordPermissions() instead.
 PrintSettings getPrintSettings()
          Get the current PrintSettings object.
 com.qoppa.pdf.resources.IResourceManager getResourceManager()
          Returns the IResourceManager for this document.
 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.
 IWatermark getWatermark()
          Returns the watermark for the PDF document.
 boolean isLinearized()
          Returns true if document is formatted for Fast Web View.
 void print(PrintSettings printSettings)
          Prints this PDF document.
 void removeDocumentListener(IDocumentListener listener)
          Internal method to keep track of document events.
 void removePrintListener(PrintListener printListener)
          Removes a PrintListener from the PDFDocument
 void setPrintSettings(PrintSettings printSettings)
          Set the PrintSettings to be used on the next printout.
 void setWatermark(IWatermark watermark)
          Sets the watermark on the PDF document.
 
Methods inherited from interface java.awt.print.Printable
print
 

Field Detail

MAGNIFICATION_FIT_WIDTH

static final String MAGNIFICATION_FIT_WIDTH
See Also:
Constant Field Values

MAGNIFICATION_FIT_VISIBLE

static final String MAGNIFICATION_FIT_VISIBLE
See Also:
Constant Field Values

MAGNIFICATION_FIT_HEIGHT

static final String MAGNIFICATION_FIT_HEIGHT
See Also:
Constant Field Values

MAGNIFICATION_FIT_PAGE

static final String MAGNIFICATION_FIT_PAGE
See Also:
Constant Field Values

MAGNIFICATION_FIT_ACTUAL

static final String MAGNIFICATION_FIT_ACTUAL
See Also:
Constant Field Values

PAGEMODE_USENONE

static final String PAGEMODE_USENONE
See Also:
Constant Field Values

PAGEMODE_USEOUTLINES

static final String PAGEMODE_USEOUTLINES
See Also:
Constant Field Values

PAGEMODE_USETHUMBS

static final String PAGEMODE_USETHUMBS
See Also:
Constant Field Values

PAGEMODE_FULLSCREEN

static final String PAGEMODE_FULLSCREEN
See Also:
Constant Field Values

PAGEMODE_USEOC

static final String PAGEMODE_USEOC
See Also:
Constant Field Values

PAGEMODE_USEATTACHMENTS

static final String PAGEMODE_USEATTACHMENTS
See Also:
Constant Field Values

PAGELAYOUT_SINGLEPAGE

static final String PAGELAYOUT_SINGLEPAGE
See Also:
Constant Field Values

PAGELAYOUT_ONECOLUMN

static final String PAGELAYOUT_ONECOLUMN
See Also:
Constant Field Values

PAGELAYOUT_TWOCOLUMNLEFT

static final String PAGELAYOUT_TWOCOLUMNLEFT
See Also:
Constant Field Values

PAGELAYOUT_TWOPAGELEFT

static final String PAGELAYOUT_TWOPAGELEFT
See Also:
Constant Field Values

PAGELAYOUT_TWOPAGERIGHT

static final String PAGELAYOUT_TWOPAGERIGHT
See Also:
Constant Field Values

PAGELAYOUT_TWOCOLUMNRIGHT

static final String PAGELAYOUT_TWOCOLUMNRIGHT
See Also:
Constant Field Values
Method Detail

getPageCount

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


getPageMode

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

PDFPermissions getPermissions()
Deprecated. Use getPDFPermissions().getPasswordPermissions() instead.

Returns the Permissions object for this document.


getPDFPermissions

AllPDFPermissions getPDFPermissions()
Returns the AllPDFPermissions object for this document. AllPDFPermissions encompasses the PasswordPermissions, DocMDPPermissions, and UsageRights Permissions.

Returns:
An AllPDFPermissions object that contains permission flags for this document.

getMagnification

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

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

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

Parameters:
pageIndex - Index of the page to return.

getLinearizationVersionNumber

String getLinearizationVersionNumber()
Returns the linearization version number.

Returns:
Linearization version number.

isLinearized

boolean isLinearized()
Returns true if document is formatted for Fast Web View.

Returns:
True if document is formatted for Fast Web View.

getLayerCount

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

Returns:
Number of layers in the document.

getLayer

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

Returns:
A reference to the PDF layer.

addDocumentListener

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


removeDocumentListener

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


print

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

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.

addPrintListener

void addPrintListener(PrintListener printListener)
Adds a PrintListener to the PDFDocument

Parameters:
printListener - - the PrintListener to be added

removePrintListener

void removePrintListener(PrintListener printListener)
Removes a PrintListener from the PDFDocument

Parameters:
printListener - - the PrintListener to be removed

getFile

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

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

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

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

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

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

Returns:
Document info fields

getDocumentViewPrefs

DocumentViewPrefs getDocumentViewPrefs()
Returns a DocumentViewPrefs object containing information about the way the document is to be presented on the screen or in print.

Returns:
The viewer preferences for the document.

getRootBookmark

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

Returns:
The root of the bookmark tree.

getPrintSettings

PrintSettings getPrintSettings()
Get the current PrintSettings object.


setPrintSettings

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

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

getAcroForm

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

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

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

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

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.


getResourceManager

com.qoppa.pdf.resources.IResourceManager getResourceManager()
Returns the IResourceManager for this document.

Returns:
The resource manager for the document.

getAnnotationFactory

IAnnotationFactory getAnnotationFactory()
Returns the AnnotationFactory for this document.

Returns:
The annotation factory for the document.

setWatermark

void setWatermark(IWatermark watermark)
Sets the watermark on the PDF document. Depending on the capabilities of the Java PDF Library, the PDF document will make callbacks to the watermark with types IWatermark.TYPE_IMAGES, IWatermark.TYPE_PRINT, IWatermark.TYPE_VIEWER when creating images, printing, and viewing the PDF document, respectively.

Parameters:
watermark - the IWatermark object to use when creating images, printing, and viewing the PDF document

getWatermark

IWatermark getWatermark()
Returns the watermark for the PDF document.

Returns:
the IWatermark object
See Also:
setWatermark(com.qoppa.pdf.IWatermark)

containsJavaScript

boolean containsJavaScript()
Returns true when the PDF document contains javascript.

Returns:
true when the PDF document contains javascript.