com.pdftools.expa
Class Document

java.lang.Object
  extended by com.pdftools.NativeLibrary
      extended by com.pdftools.expa.ExpaInitialize
          extended by com.pdftools.expa.Document

public class Document
extends ExpaInitialize


Nested Class Summary
 
Nested classes/interfaces inherited from class com.pdftools.expa.ExpaInitialize
ExpaInitialize.CONTENTOBJECT, ExpaInitialize.ORIENTATION, ExpaInitialize.Rectangle, ExpaInitialize.TransformMatrix
 
Nested classes/interfaces inherited from class com.pdftools.NativeLibrary
NativeLibrary.COLORCONVERSION, NativeLibrary.COLORSPACE, NativeLibrary.COMPRESSION, NativeLibrary.DITHERINGMODE, NativeLibrary.ERRORCODE, NativeLibrary.FONTTYPE, NativeLibrary.PERMISSION, NativeLibrary.RENDEREROPTION, NativeLibrary.RENDERINGMODE, NativeLibrary.ROTATEMODE, NativeLibrary.STRIPTYPE
 
Field Summary
 
Fields inherited from class com.pdftools.NativeLibrary
VERSION
 
Constructor Summary
Document()
          Deprecated. replaced by Document(String, String) and Document(byte[], String)
Document(byte[] pDocumentBytes, java.lang.String szPassword)
           
Document(java.lang.String strFilename, java.lang.String strPassword)
           
 
Method Summary
 void close()
          close an open document.
 void destroyObject()
          Release handle for the process.
 java.lang.String getAuthor()
          get the Author of the document.
 java.util.Date getCreationDate()
          get the creation date of the document.
 int getCurrentOutlineLevel()
          get the level of the current outline
 ColorSpace getFirstColorSpaceResource()
          get the first color space resource
 Font getFirstFontResource()
          get the first font resource.
 Image getFirstImageResource()
          get the first image resource.
 OutlineItem getFirstOutlineItem()
          get the first outline item resource
 java.lang.String getInfoEntry(java.lang.String strkey)
          get the value of a custom entry of the document.
 java.lang.String getKeywords()
          get the keywords of the document.
 int getLastError()
          get the latest error code.
 int getMajorVersion()
          get the major version of the document.
 int getMinorVersion()
          get the minor version of the document.
 java.util.Date getModDate()
          get the modification date of the document.
 ColorSpace getNextColorSpaceResource()
          get the next color space resource
 Font getNextFontResource()
          get the next font resource.
 Image getNextImageResource()
          get the next image resource.
 OutlineItem getNextOutlineItem(int nMaxLevel, boolean bReturnOpenOnly)
          get the next outline item resource
 Page getPage()
          get the page interface.
 int getPageCount()
          get the number of pages of an open document
 int getPageNo()
          get the currently selected page of an open document.
 java.lang.String getSubject()
          get the subject of the document.
 java.lang.String getTitle()
          get the title of the document.
 boolean isEncrypted()
          get the information if the document is encrypted.
 boolean open(java.lang.String strFilename, java.lang.String strPassword)
          open a PDF random access disk file
 boolean openMem(byte[] pDocumentBytes, java.lang.String szPassword)
          open a PDF memory block
 boolean setPageNo(int iPageNo)
          set the currently selected page of an open document.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Document

public Document()
Deprecated. replaced by Document(String, String) and Document(byte[], String)


Document

public Document(java.lang.String strFilename,
                java.lang.String strPassword)

Document

public Document(byte[] pDocumentBytes,
                java.lang.String szPassword)
Method Detail

destroyObject

public void destroyObject()
Release handle for the process.


open

public boolean open(java.lang.String strFilename,
                    java.lang.String strPassword)
open a PDF random access disk file

Parameters:
strFilename - the file name and optionally the file path
strPassword - the user or the owner password of the encrypted PDF document
Returns:
true if the file could successfully be opened

openMem

public boolean openMem(byte[] pDocumentBytes,
                       java.lang.String szPassword)
open a PDF memory block

Parameters:
pDocumentBytes - the memory block containing the PDF file given as a one dimensional byte array
strPassword - the user or the owner password of the encrypted PDF document
Returns:
true if the file could successfully be opened

close

public void close()
close an open document. If the document is already closed the method does nothing


getLastError

public int getLastError()
get the latest error code.

Returns:
the latest error code.

isEncrypted

public boolean isEncrypted()
get the information if the document is encrypted.

Returns:
true if the PDF document is encrypted.

getMajorVersion

public int getMajorVersion()
get the major version of the document.

Returns:
the major version of the document.

getMinorVersion

public int getMinorVersion()
get the minor version of the document.

Returns:
the Minor version of the document.

getTitle

public java.lang.String getTitle()
get the title of the document.

Returns:
the title from the document’s info object.

getAuthor

public java.lang.String getAuthor()
get the Author of the document.

Returns:
the Author from the document’s info object.

getSubject

public java.lang.String getSubject()
get the subject of the document.

Returns:
the Subject from the document’s info object.

getKeywords

public java.lang.String getKeywords()
get the keywords of the document.

Returns:
the Keywords from the document’s info object.

getModDate

public java.util.Date getModDate()
get the modification date of the document.

Returns:
the modification date from the document’s info object.

getCreationDate

public java.util.Date getCreationDate()
get the creation date of the document.

Returns:
the creation date from the document’s info object.

getInfoEntry

public java.lang.String getInfoEntry(java.lang.String strkey)
get the value of a custom entry of the document.

Returns:
the value of a custom entry from the info object.

getPageCount

public int getPageCount()
get the number of pages of an open document

Returns:
the number of pages of an open document

setPageNo

public boolean setPageNo(int iPageNo)
set the currently selected page of an open document. The numbers are counted from 1 for the first page to the value of the PageCount attribute for the last page.

Parameters:
iPageNo - the page no to be set
Returns:
true on success

getPageNo

public int getPageNo()
get the currently selected page of an open document. The numbers are counted from 1 for the first page to the value of the PageCount attribute for the last page.

Returns:
the page no

getPage

public Page getPage()
get the page interface.

Returns:
an interface to the currently selected page of a document.

getFirstFontResource

public Font getFirstFontResource()
get the first font resource.

Returns:
in interface the first font resource.

getNextFontResource

public Font getNextFontResource()
get the next font resource.

Returns:
in interface the next font resource.

getFirstImageResource

public Image getFirstImageResource()
get the first image resource.

Returns:
in interface the first image resource.

getNextImageResource

public Image getNextImageResource()
get the next image resource.

Returns:
in interface the next image resource.

getFirstColorSpaceResource

public ColorSpace getFirstColorSpaceResource()
get the first color space resource

Returns:
in interface the first color space resource

getNextColorSpaceResource

public ColorSpace getNextColorSpaceResource()
get the next color space resource

Returns:
in interface the next color space resource

getFirstOutlineItem

public OutlineItem getFirstOutlineItem()
get the first outline item resource

Returns:
in interface the first outline item resource

getNextOutlineItem

public OutlineItem getNextOutlineItem(int nMaxLevel,
                                      boolean bReturnOpenOnly)
get the next outline item resource

Parameters:
nMaxLevel - The maximum level of the depth of the oulines
bReturnOpenOnly - Return only outlines which are opened
Returns:
in interface the next outline item resource

getCurrentOutlineLevel

public int getCurrentOutlineLevel()
get the level of the current outline

Returns:
the level of the current outline