Gnostice PDFOne
Pro. Ed. v1.41


com.gnostice.pdfone
Class PdfReader

java.lang.Object
  extended bycom.gnostice.pdfone.PdfReader
All Implemented Interfaces:
Usable

public class PdfReader
extends Object
implements Usable

This class is used in conjunction with the PdfDocument class to read from a file and possibly make changes and save it all to another file. For this purpose, a PdfReader object needs two components - an input stream and an output stream. For this reason, PdfReader does not have a default constructor. Instead, a PdfReader object is created by explicitly specifying its input stream and/or its output stream. The class has several methods to achieve this. Once a PdfReader object has been created, it is used to in creating a PdfDocument that can be set to read from an existing file or stream.

Since:
1.0
Version:
1.0
See Also:
PdfDocument

Field Summary
 
Fields inherited from interface com.gnostice.pdfone.Usable
INCHES_TO_POINTS, MM_TO_INCHES, MM_TO_POINTS, PDF_A, PDF_AA, PDF_AC, PDF_ACROFORM, PDF_ACTION, PDF_ALTERNATEPRESENTATIONS, PDF_ANNOT, PDF_ANNOT_DEFAULT_TITLE, PDF_ANNOT_NAME, PDF_ANNOT_SUBJECT, PDF_ANNOTS, PDF_AP, PDF_ARRAYEND, PDF_ARRAYSTART, PDF_ARTBOX, PDF_AS, PDF_ASCENT, PDF_ASCII85, PDF_ASCII85_NEW, PDF_ASCIIHEX, PDF_ASCIIHEX_NEW, PDF_AUTHOR, PDF_AVGWIDTH, PDF_B, PDF_BASEFONT, PDF_BBOX, PDF_BC, PDF_BE, PDF_BEFOREFORMAT, PDF_BEGINTEXT, PDF_BG, PDF_BINARYDATA, PDF_BITS_PER_COMPONENT, PDF_BL, PDF_BLEEDBOX, PDF_BLINDS, PDF_BMC, PDF_BORDER, PDF_BOX, PDF_BS, PDF_BTN, PDF_C, PDF_CA, PDF_CA_SMALL, PDF_CAPHEIGHT, PDF_CARETANNOT, PDF_CARRIAGE, PDF_CATALOG, PDF_CENTER_WINDOW, PDF_CH, PDF_CID_TO_GID_MAP, PDF_CIDFONT_TYPE1, PDF_CIDFONT_TYPE2, PDF_CIDSYSTEM_INFO, PDF_CIRCLEANNOT, PDF_CL, PDF_CM, PDF_COLOMNS, PDF_COLOR, PDF_COLORSPACE, PDF_CONTENTS, PDF_COUNT, PDF_COVER, PDF_CREATIONDATE, PDF_CREATOR, PDF_CROPBOX, PDF_CS, PDF_CSP, PDF_D, PDF_DA, PDF_DATE, PDF_DATE_FORMAT, PDF_DCTDECODE, PDF_DCTDECODE_NEW, PDF_DECODEPARMS, PDF_DESC, PDF_DESCENDANT, PDF_DESCENDANT_FONTS, PDF_DESCENT, PDF_DESTINATION, PDF_DESTS, PDF_DEVICE_CMYK, PDF_DEVICE_GRAY, PDF_DEVICE_RGB, PDF_DI, PDF_DICTEND, PDF_DICTSTART, PDF_DIRECTION, PDF_DISPLAY_DOCTITLE, PDF_DISPLAY_DURATION, PDF_DISSOLVE, PDF_DM, PDF_DOC_SUBJECT, PDF_DOS, PDF_DP, PDF_DR, PDF_DS, PDF_DV, PDF_DW, PDF_E, PDF_EF, PDF_EMBEDDEDFILE, PDF_EMBEDDEDFILES, PDF_EMC, PDF_ENCODING, PDF_ENCRYPT, PDF_ENDOBJ, PDF_ENDPATH, PDF_ENDSTREAM, PDF_ENDTEXT, PDF_EOCLIP, PDF_EOF, PDF_EXTGSTATE, PDF_F, PDF_FADE, PDF_FALSE, PDF_FDESCRIPTOR, PDF_FIELD_FLAG, PDF_FIELDS, PDF_FILEATTACHMENTANNOT, PDF_FILESPEC, PDF_FILTER, PDF_FIRST, PDF_FIRST_PAGE, PDF_FIRSTCHAR, PDF_FIT, PDF_FIT_WINDOW, PDF_FITB, PDF_FITBH, PDF_FITBV, PDF_FITH, PDF_FITR, PDF_FITV, PDF_FIXEDPRINT, PDF_FLAGS, PDF_FLATE, PDF_FLATE_NEW, PDF_FLY, PDF_FO, PDF_FONT, PDF_FONTBBOX, PDF_FONTFILE, PDF_FONTFILE_2, PDF_FontFile_3, PDF_FONTNAME, PDF_FONTNAMEPREFIX, PDF_FORM, PDF_FORMFEED, PDF_FORMFONTPREFIX, PDF_FREE_TEXT_TYPEWRITER, PDF_FREETEXTANNOT, PDF_FS, PDF_FT, PDF_FULLSCREEN, PDF_GLITTER, PDF_GOTO_ACTION, PDF_GROUP, PDF_GS, PDF_H, PDF_HEADER, PDF_HEIGHT, PDF_HEXSTRINGEND, PDF_HEXSTRINGSTART, PDF_HIDE_MENUBAR, PDF_HIDE_TOOLBAR, PDF_HIDE_WINDOWUI, PDF_HORIZ_STEM, PDF_HORIZONTAL, PDF_I, PDF_IC, PDF_ID, PDF_IDS, PDF_IF, PDF_IMAGE, PDF_IMAGEB, PDF_IMAGEC, PDF_IMAGEI, PDF_IMPORTDATA, PDF_INDEX, PDF_INDEXED, PDF_INFO, PDF_INK, PDF_INKLIST, PDF_INWARD, PDF_IT, PDF_ITALANGLE, PDF_IX, PDF_JAVASCRIPT, PDF_JAVASCRIPT_ACTION, PDF_JS, PDF_KEYSTROKE, PDF_KEYWORDS, PDF_KIDS, PDF_L, PDF_L2R, PDF_LANG, PDF_LAST, PDF_LAST_PAGE, PDF_LASTCHAR, PDF_LAUNCH_ACTION, PDF_LE, PDF_LEGAL, PDF_LENGTH, PDF_LENGTH_1, PDF_LENGTH_2, PDF_LENGTH_3, PDF_LF, PDF_LINEANNOT, PDF_LINKANNOT, PDF_LITERALSTRINGEND, PDF_LITERALSTRINGSTART, PDF_LZWDECODE, PDF_M, PDF_MAC, PDF_MARKINFO, PDF_MAXLEN, PDF_MAXWIDTH, PDF_MEDIABOX, PDF_METADATA, PDF_MISSINGWIDTH, PDF_MK, PDF_MODDATE, PDF_N, PDF_NAME, PDF_NAMED, PDF_NAMED_ACT_FIND, PDF_NAMED_ACT_OPEN, PDF_NAMED_ACT_PRINT, PDF_NAMED_ACT_SEARCH, PDF_NAMES, PDF_NAMESTART, PDF_NEEDAPPEARANCES, PDF_NEWLINE, PDF_NEWWINDOW, PDF_NEXT, PDF_NEXT_PAGE, PDF_NO_COMP_OBJ, PDF_NONFULLSCREEN_PAGEMODE, PDF_NULL, PDF_O, PDF_OBJ, PDF_OBJSTREAM, PDF_OCPROPERTIES, PDF_OFF, PDF_ONECOLUMN, PDF_OPEN, PDF_OPEN_ACTION, PDF_OPT, PDF_OUTLINES, PDF_OUTPUTINTENTS, PDF_OUTWARD, PDF_P, PDF_PAGE, PDF_PAGECLOSE, PDF_PAGEINVISIBLE, PDF_PAGELABELS, PDF_PAGELAYOUT, PDF_PAGEMODE, PDF_PAGEOPEN, PDF_PAGES, PDF_PAGEVISIBLE, PDF_PAINT_TYPE, PDF_PARAMS, PDF_PARENT, PDF_PATTERN, PDF_PATTERN_TYPE, PDF_PBD, PDF_PC, PDF_PDC, PDF_PDF, PDF_PERMS, PDF_PFD, PDF_PH, PDF_PIECEINFO, PDF_POLYGONANNOT, PDF_POLYLINEANNOT, PDF_POPUP, PDF_PREDICTOR, PDF_PREV, PDF_PREV_PAGE, PDF_PROCSET, PDF_PRODUCER, PDF_PROPERTIES, PDF_PUSH, PDF_PV, PDF_Q, PDF_QUADPOINTS, PDF_R, PDF_R2L, PDF_RC, PDF_RD, PDF_RE, PDF_RECALCULATE, PDF_RECT, PDF_REMOTEGOTO_ACTION, PDF_RENDITIONS, PDF_REPLACE, PDF_RESET_FORM, PDF_RESOURCES, PDF_RESTORE_GS, PDF_RI, PDF_ROOT, PDF_ROTATE, PDF_RUNLENGTH, PDF_RUNLENGTH_NEW, PDF_S, PDF_SCN, PDF_SHADING, PDF_SHOWIMG, PDF_SHOWTEXT, PDF_SINGLE_QUOTES, PDF_SINGLEPAGE, PDF_SIZE, PDF_SP, PDF_SPIDERINFO, PDF_SPLIT, PDF_SQUAREANNOT, PDF_SS, PDF_STAMPANNOT, PDF_STARTXREF, PDF_STORE_GS, PDF_STREAM, PDF_STRUCT_TREE, PDF_SUBMIT_FORM, PDF_SUBTYPE, PDF_T, PDF_TAB, PDF_TEMPLATES, PDF_TEXT, PDF_TEXTANNOT, PDF_TEXTDIMENSION, PDF_TEXTFONT, PDF_TEXTLEAD, PDF_TEXTMATRIX, PDF_TEXTNEWLINESTART, PDF_TEXTRENDER, PDF_TEXTWIDTH, PDF_THREADS, PDF_THUMB, PDF_TILING_TYPE, PDF_TITLE, PDF_TM, PDF_TOUNICODE, PDF_TP, PDF_TRAILER, PDF_TRANSITION, PDF_TRIMBOX, PDF_TRUE, PDF_TRUETYPE, PDF_TU, PDF_TWOCOLUMN_LEFT, PDF_TWOCOLUMN_RIGHT, PDF_TWOPAGE_LEFT, PDF_TWOPAGE_RIGHT, PDF_TX, PDF_TYPE, PDF_TYPE0, PDF_TYPE1, PDF_U, PDF_UNCOVER, PDF_UNIX, PDF_URI_ACTION, PDF_URL, PDF_URLS, PDF_USEATTACHMENTS, PDF_USENONE, PDF_USEOC, PDF_USEOUTLINES, PDF_USETHUMBS, PDF_V, PDF_VALUECHANGE, PDF_VERSION, PDF_VERT_STEM, PDF_VERTICAL, PDF_VERTICES, PDF_VIEWER_PREFERENCES, PDF_W, PDF_WATERMARKANNOT, PDF_WIDGET, PDF_WIDTH, PDF_WIDTHS, PDF_WINANSIENCODING, PDF_WIPE, PDF_X, PDF_XOBJECT, PDF_XREF, PDF_XREFSTMOFFSET, PDF_XREFSTREAM, PDF_XSTEP, PDF_XYZ, PDF_YES, PDF_YSTEP, PIXEL_PER_INCH, RUBICON_EMBEDDED, SITE, TEXT, TWIPS_TO_POINTS
 
Method Summary
 PdfObject dereferObjectFDF(int objNo)
           
 void dispose()
          Closes all input/output (I/O) streams associated with this PdfReader.
static PdfReader fileReader(File inFile)
          Returns a new PdfReader object created with specified File object as its input stream.
static PdfReader fileReader(File inFile, OutputStream os)
          Returns a new PdfReader object created with specified File object as its input stream and specified OutputStream object as its output stream.
static PdfReader fileReader(File inFile, String outFilePath)
          Returns a new PdfReader object created with specified File object as its input stream and file specified by pathname outFilePath as its output stream.
static PdfReader fileReader(String inFilePath)
          Returns a new PdfReader object created with file specified by pathname inFilePath as its input stream.
static PdfReader fileReader(String inFilePath, OutputStream os)
          Returns a new PdfReader object created with file specified by pathname inFilePath as its input stream and specified OutputStream object as its output stream.
static PdfReader fileReader(String inFilePath, String outFilePath)
          Returns a new PdfReader object created with file specified by pathname inFilePath as its input stream and file specified by pathname outFilePath as its output stream.
static PdfReader fileReaderFDF(File file)
           
static PdfReader fileStreamReader(FileInputStream fis)
          Returns a new PdfReader object created with the specified FileInputStream object as its input stream.
static PdfReader fileStreamReader(FileInputStream fis, OutputStream os)
          Returns a new PdfReader object created with specified FileInputStream object as its input stream and specified OutputStream object as its output stream.
static PdfReader fileStreamReader(FileInputStream fis, String outFilePath)
          Returns a new PdfReader object created with specified FileInputStream object as its input stream and file specified by pathname outFilePath as its output stream.
 String getOutFilePath()
          Retrieves pathname of the file currently set as output stream for this PdfReader.
 OutputStream getOutputStream()
          Retrieves OutputStream object currently set as output stream for this PdfReader.
 PdfDict parseTrailerFdf(long offSet)
           
 void setOnPageReadHandler(PdfPageReadHandler onPageReadHandler)
           
 void setOnPasswordHandler(PdfPasswordHandler onPasswordHandler)
           
 void setOutFilePath(String outFilePath)
          Sets file specified by pathname outFilePath as output stream for this PdfReader.
 void setOutputStream(OutputStream os)
          Sets specified OutputStream object as output stream for this PdfReader.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

dispose

public void dispose()
             throws IOException
Closes all input/output (I/O) streams associated with this PdfReader.

Throws:
IOException - An input/output error has occurred.
Since:
1.0
Sample Code
See example.

fileReader

public static PdfReader fileReader(String inFilePath)
                            throws IOException
Returns a new PdfReader object created with file specified by pathname inFilePath as its input stream.

Parameters:
inFilePath - pathname of the file that needs to be used as the input stream
Returns:
a new PdfReader object
Throws:
IOException - if an I/O error occurs.
Since:
1.0
Sample Code
See example.

fileReader

public static PdfReader fileReader(File inFile)
                            throws IOException,
                                   PdfException
Returns a new PdfReader object created with specified File object as its input stream.

Parameters:
inFile - File object of the input stream
Returns:
a new PdfReader object
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

fileStreamReader

public static PdfReader fileStreamReader(FileInputStream fis)
                                  throws IOException,
                                         PdfException
Returns a new PdfReader object created with the specified FileInputStream object as its input stream.

Parameters:
fis - FileInputStream object of the input stream
Returns:
a new PdfReader object
Throws:
IOException - if an input/output exception has occurred.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

fileReader

public static PdfReader fileReader(String inFilePath,
                                   String outFilePath)
                            throws IOException
Returns a new PdfReader object created with file specified by pathname inFilePath as its input stream and file specified by pathname outFilePath as its output stream.

Parameters:
inFilePath - pathname of the file that needs to be used as the input stream
outFilePath - pathname of the file that needs to be used as the output stream
Returns:
a new PdfReader object
Throws:
IOException - if an I/O error occurs.
Since:
1.0
Sample Code
See example.

fileReader

public static PdfReader fileReader(File inFile,
                                   String outFilePath)
                            throws IOException,
                                   PdfException
Returns a new PdfReader object created with specified File object as its input stream and file specified by pathname outFilePath as its output stream.

Parameters:
inFile - File object of the input stream
outFilePath - pathname of the file that needs to be used as the output stream
Returns:
a new PdfReader object
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

fileStreamReader

public static PdfReader fileStreamReader(FileInputStream fis,
                                         String outFilePath)
                                  throws IOException,
                                         PdfException
Returns a new PdfReader object created with specified FileInputStream object as its input stream and file specified by pathname outFilePath as its output stream.

Parameters:
fis - FileInputStream object of the input stream
outFilePath - pathname of the file that needs to be used as the output stream
Returns:
a new PdfReader object
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

fileReader

public static PdfReader fileReader(String inFilePath,
                                   OutputStream os)
                            throws IOException
Returns a new PdfReader object created with file specified by pathname inFilePath as its input stream and specified OutputStream object as its output stream.

Parameters:
inFilePath - pathname of the file that needs to be used as the input stream
os - OutputStream object of the output stream
Returns:
a new PdfReader object
Throws:
IOException - if an I/O error occurs.
Since:
1.0
Sample Code
See example.

fileReader

public static PdfReader fileReader(File inFile,
                                   OutputStream os)
                            throws IOException,
                                   PdfException
Returns a new PdfReader object created with specified File object as its input stream and specified OutputStream object as its output stream.

Parameters:
inFile - File object of the input stream
os - OutputStream object of the output stream
Returns:
a new PdfReader object
Throws:
IOException - if an input/output exception had occurred.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

fileStreamReader

public static PdfReader fileStreamReader(FileInputStream fis,
                                         OutputStream os)
                                  throws IOException,
                                         PdfException
Returns a new PdfReader object created with specified FileInputStream object as its input stream and specified OutputStream object as its output stream.

Parameters:
fis - FileInputStream object of the input stream
os - OutputStream object of the output stream
Returns:
a new PdfReader object
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

getOutputStream

public OutputStream getOutputStream()
Retrieves OutputStream object currently set as output stream for this PdfReader.

Returns:
OutputStream object currently set as the output stream
Since:
1.0

setOutputStream

public void setOutputStream(OutputStream os)
Sets specified OutputStream object as output stream for this PdfReader.

Parameters:
os - OutputStream object that needs to be set as the output stream
Since:
1.0

getOutFilePath

public String getOutFilePath()
Retrieves pathname of the file currently set as output stream for this PdfReader.

Returns:
pathname of the file currently set as the output stream
Since:
1.0

setOutFilePath

public void setOutFilePath(String outFilePath)
Sets file specified by pathname outFilePath as output stream for this PdfReader.

Parameters:
outFilePath - pathname of the file that needs to be set as the output stream
Since:
1.0

setOnPasswordHandler

public void setOnPasswordHandler(PdfPasswordHandler onPasswordHandler)

setOnPageReadHandler

public void setOnPageReadHandler(PdfPageReadHandler onPageReadHandler)

dereferObjectFDF

public PdfObject dereferObjectFDF(int objNo)
                           throws PdfException,
                                  IOException
Throws:
PdfException
IOException

fileReaderFDF

public static PdfReader fileReaderFDF(File file)
                               throws IOException
Throws:
IOException

parseTrailerFdf

public PdfDict parseTrailerFdf(long offSet)
                        throws IOException,
                               PdfException
Throws:
IOException
PdfException

Gnostice PDFOne
Pro. Ed. v1.41

To contact our support team, send an e-mail to support@gnostice.com.
 
© 2006 Gnostice Information Technologies Private Limited. All rights reserved.
www.gnostice.com