Gnostice PDFOne
Pro. Ed. v5.0.0


com.gnostice.pdfone
Class PdfDocument

java.lang.Object
  extended bycom.gnostice.pdfone.PdfStdDocument
      extended bycom.gnostice.pdfone.PdfProDocument
          extended bycom.gnostice.pdfone.PdfDocument
All Implemented Interfaces:
Serializable, Usable

public class PdfDocument
extends com.gnostice.pdfone.PdfProDocument
implements Serializable

This class represents a PDF document.

You can use an instance of this class to create a new PDF document from scratch. Alternatively, you can load an existing document and make modifications to it. A loaded PDF document can also be displayed using a PdfViewer component and printed using a PdfPrinter component.

To create a new PDF document, just create a new instance of this class. When you do this, a blank page will be automatically added to the document. For more pages, you need to create PdfPage objects and add to the document. You can create content across pages using the methods in this class or individually using similar methods in the PdfPage class. Finally, you need to save the document to a disk file, stream object, or a File instance.

import com.gnostice.pdfone.PdfDocument;
 import com.gnostice.pdfone.PdfPage;
 import com.gnostice.pdfone.PdfPageSize;

 public class PdfDocument_Creation_Example
 {
     public static void main(String[] args)
     {
         // Create a new PDF document 
         PdfDocument doc = new PdfDocument();
         // A blank page (page #1) is automatically added

         try
         {
             // Create content page #1 
             doc.writeText("Hello, world!", 100, 100);
             doc.drawImage("sample_image.jpg", 100, 200);
             doc.drawRect(400, 200, 50, 75);

             // Create another page and add to document
             PdfPage page2 = new PdfPage(PdfPageSize.A4);
             page2.writeText("Hello again, world!", 100, 100);
             doc.add(page2);

             // Write text accross page #1 and #2
             doc.writeText("Page #<%PageNo%>", 250, 500, "1,2");
             // PageNo is one of several built-in placeholders
             // you can use in text strings rendered on pages.
             // Placeholders are delimited by <% and %>.

             // Set document to be launched after it is saved
             doc.setOpenAfterSave(true);  // Works only in Microsoft Windows

             // Save document to disc
             doc.save("sample_doc.pdf");

             // Close I/O resources used for the document
             doc.close();

         }
         catch (Exception e)
         {
             System.out.println("Sorry, an error occurred - "
                 + e.getMessage());
         }

     }
 }

To edit, enhance, display or print a PDF document, you need load the document. After loading the document, you can use the content creation methods of this class. Alternatively, you can access individual pages and use methods of the PdfPage class.

import java.awt.Color;

import com.gnostice.pdfone.PdfDocument;
import com.gnostice.pdfone.PdfPage;
import com.gnostice.pdfone.encodings.PdfEncodings;
import com.gnostice.pdfone.fonts.PdfFont;

public class PdfDocument_Editing
{

    public static void main(String[] args) {

        PdfDocument doc = new PdfDocument();

        try {
          // Load an existing PDF document
          doc.load("sample_doc.pdf");
          // Detect number of pages in the document 
          System.out.println("The loaded document has " + 
                             doc.getPageCount() + 
                             " pages.");

          if (doc.getPageCount() > 1) {

              // Write text using a TrueType font 
              PdfFont fontTahoma = 
                  PdfFont.create("C:\\WINDOWS\\Fonts\\tahoma.ttf", 
                                 15, 
                                 PdfEncodings.WINANSI, PdfFont.EMBED_SUBSET);          
              doc.writeText("This text uses subset-embedded Tahoma.", 
                            fontTahoma,  // font
                            300,         // x-coordinate
                            40,          // y-coordinate
                            "1-2");      // page range

              // Create a standard Type 1 font, which requires 
              // no font embedding
              PdfFont fontCourier =
                  PdfFont.create(
                      "Courier", // Or Helvetica, Roman, Symbol, Zapf-Dingbats     
                      PdfFont.BOLD, 
                      84, 
                      PdfEncodings.WINANSI);
              fontCourier.setColor(Color.LIGHT_GRAY);

              // Obtain page #2
              PdfPage page2 = doc.getPage(2);
              // Write text on page #2
              page2.writeText("This text uses standard Type 1 Courier", 
                              fontCourier, // Standard type 1 font
                              300.0,       // x-coordinate
                              150,         // y-coordinate
                              45);         // angle of rotation
          }

          // Set document to be launched after it is saved
          doc.setOpenAfterSave(true);  // Works only in Microsoft Windows

          // Save changes to a file
          doc.save("modified_doc.pdf");

          // Close I/O resources used for the document
          doc.close();

        } catch (Exception e) {
          System.out.println("Sorry, an error occurred - " + e.getMessage());  
        }
    }    
}

The PdfDocument class offers numerous methods to work with elements such as text, images, shapes, tables, form fields, annotations, bookmarks, and pages in PDF documents.

When content is written to a new PdfDocument object, a default PdfPage object is automatically created and added to the PdfDocument. This PdfPage also becomes PdfDocument's "current page." Whenever data is written to a document without explicitly specifying a page range, the data is automatically written to the PdfDocument's current page. This does not change even when new PdfPage objects have been added to the PdfDocument object. To make a page that is to be added set as the current page, the overloaded PdfStdDocument.add(PdfPage p, boolean setAsCurrentPage) method should be used. To write content to a specific page that is not necessarily the current page, methods that have a page range argument should be used.

While writing to a PdfDocument object, the position where the content should appear is very important. The coordinates of the position is always made in reference to the top-left corner the PdfDocument's current page. Whenever coordinates, position, or sizes are used, they are usually applied in terms of the document's current measurement unit, which can be pixels, twips, points, inches, or centimeters. However, in situations where a measurement unit cannot be applied or determined, the measurement unit will be by default points.

Every document has a default pen setting and a default brush setting. The pen for example is used to stroke the borders when a rectangle is drawn. In the same example, the brush would be used when the area bounded by the rectangle is filled.

See Also:
PdfWriter, PdfReader, PdfPage, Serialized Form

Field Summary
static int ALIGNMENT_CENTER
          Constant for aligning form field text to the center.
static int ALIGNMENT_LEFT
          Constant for aligning form field text to the left.
static int ALIGNMENT_RIGHT
          Constant for aligning form field text to right.
static int MERGE_INCLUDE_ALL
          Flag for inclusion of annotations, bookmarks, document-level actions, page-level actions, and form fields when merging documents.
static int MERGE_INCLUDE_ANNOTATIONS
          Flag for inclusion of annotations when merging documents.
static int MERGE_INCLUDE_BOOKMARKS
          Flag for inclusion of bookmarks when merging documents.
static int MERGE_INCLUDE_DOCUMENT_ACTIONS
          Flag for inclusion of document-level actions when merging documents.
static int MERGE_INCLUDE_FORMFIELDS
          Flag for inclusion of form fields when merging documents.
static int MERGE_INCLUDE_PAGE_ACTIONS
          Flag for inclusion of page-level actions when merging documents.
static int TIFF_Compression_CCITT_RLE
          Constant for using modified Huffman compression (1 bit per component) when saving to a TIFF image.
static int TIFF_Compression_CCITT_T4
          Constant for using CCITT T.4 bilevel encoding or Group 3 facsimile compression (1 bit per component) when saving to a TIFF image.
static int TIFF_Compression_CCITT_T6
          Constant for using CCITT T.6 bilevel encoding or Group 4 facsimile compression (1 bit per component) when saving to a TIFF image.
static int TIFF_Compression_Deflate
          Constant for using "Zip-in-TIFF" compression (8 bits per component) when saving to a TIFF image.
static int TIFF_Compression_EXIF_JPEG
          Constant for using EXIF-specific JPEG compression (8 bits per component) when saving to a TIFF image.
static int TIFF_Compression_JPEG
          Constant for using "'New' JPEG-in-TIFF" lossy compression (8 bits per component) when saving to a TIFF image.
static int TIFF_Compression_LZW
          Constant for using LZW compression (8 bits per component) when saving to a TIFF image.
static int TIFF_Compression_NONE
          Constant for using no compression when saving to a TIFF image.
static int TIFF_Compression_PackBits
          Constant for using "byte-oriented, run length compression" (8 bits per component) when saving to a TIFF image.
static int TIFF_Compression_ZLib
          Constant for using "Deflate/Inflate compression" (8 bits per component) when saving to a TIFF image.
static String VERSION_1_4
          PDF version 1.4
static String VERSION_1_5
          PDF version 1.5
static String VERSION_1_6
          PDF version 1.6
 
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_AuthEvent, 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_BYTERANGE, PDF_C, PDF_CA, PDF_CA_SMALL, PDF_CAPHEIGHT, PDF_CARETANNOT, PDF_CARRIAGE, PDF_CATALOG, PDF_CENTER_WINDOW, PDF_CF, PDF_CFM, 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_COLORSPACE_CALGRAY, PDF_COLORSPACE_CALRGB, PDF_COLORSPACE_DEVICEN, PDF_COLORSPACE_ICCBASED, PDF_COLORSPACE_LAB, PDF_COLORSPACE_SEPARATION, PDF_CONTACTINFO, 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_DESCENDENTFONTS, PDF_DESCENT, PDF_DESTINATION, PDF_DESTS, PDF_DEVICE_CMYK, PDF_DEVICE_GRAY, PDF_DEVICE_RGB, PDF_DI, PDF_DICTEND, PDF_DICTSTART, PDF_DIFFERENCES, PDF_DIRECTION, PDF_DISPLAY_DOCTITLE, PDF_DISPLAY_DURATION, PDF_DISSOLVE, PDF_DM, PDF_DOC_SUBJECT, PDF_DOCMDP, 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_ENCRYPTMETADATA, 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_FONTDESCRIPTOR, PDF_FONTFILE, PDF_FONTFILE_2, PDF_FontFile_3, PDF_FONTFILE2, PDF_FONTNAME, PDF_FONTNAMEPREFIX, PDF_FORM, PDF_FORMFEED, PDF_FORMFONTPREFIX, PDF_FREE_TEXT_CALLOUT, 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_HIGHLIGHT, 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_LOCATION, PDF_LZWDECODE, PDF_M, PDF_MAC, PDF_MARKINFO, PDF_MATRIX, 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_REASON, 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_SHOWTEXT_TJ, PDF_SIG, PDF_SIG_FILTER_ADOBE_PPKLITE, PDF_SIG_FILTER_ADOBE_PPKMS, PDF_SIG_SUBFILTER_ADBE_PKCS7_DETACHED, PDF_SIG_SUBFILTER_ADBE_PKCS7_SHA1, PDF_SINGLE_QUOTES, PDF_SINGLEPAGE, PDF_SIZE, PDF_SP, PDF_SPIDERINFO, PDF_SPLIT, PDF_SQUAREANNOT, PDF_SQUIGGLY, PDF_SS, PDF_STAMPANNOT, PDF_STARTXREF, PDF_StmF, PDF_STORE_GS, PDF_STREAM, PDF_StrF, PDF_STRIKEOUT, PDF_STRUCT_TREE, PDF_SUBFILTER, 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_TJ_OPERAND_END, PDF_TJ_OPERAND_START, 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_UNDERLINE, 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
 
Constructor Summary
PdfDocument()
           
PdfDocument(PdfReader r)
          Deprecated. Constructs a new PdfDocument with a PdfReader object. The new PdfDocument object is used to read/modify an existing file - reading mode.
PdfDocument(PdfWriter w)
          Deprecated. Constructs a new PdfDocument object with a PdfWriter object. The new PdfDocument object is used to create a new PDF file - creation mode.
 
Method Summary
 void add(PdfPage p)
          Adds specified PdfPage to this PdfDocument.
 void add(PdfPage p, boolean setAsCurrentPage)
          Adds specified PdfPage to this PdfDocument and, if setAsCurrentPage is true, sets the PdfPage as the PdfDocument's current page.
 void addAction(int namedAction)
          Adds a named action that needs to be executed by viewer applications when they display the document.
 void addAction(int actionType, int pageNum)
          Adds a go-to action to the document.
 void addAction(int actionType, int pageNum, float x, float y, float zoomPercentage)
          Adds a go-to action of specified type to specified page with destination set to specified location and magnification.
 void addAction(int event, int actionType, String javascript)
          Adds a Javascript action to specified document-level event.
 void addAction(int actionType, String javascriptOrURI)
          Sets this document to execute action specified by javascriptOrURI when the document is displayed.
 void addAction(int actionType, String applicationToLaunch, boolean isPrint, String parameterToApplication)
          Add a document-level action for launching a specified application with specified parameters or open/print specified document.
 void addAction(PdfGotoAction gotoAction)
          Adds specified document-level go-to PDF action to document.
 void addAnnotation(PdfAnnot annotation, int pageNo)
          Adds specified annotation to specified page.
 void addAnnotationList(List annotList, int pageNo)
          Adds a specified list of annotations to a specified page.
 void addAnnotationList(List annotList, int pageNo, boolean removeExistingAnnots)
          Adds a specified list of annotations to a specified page, and removes or keeps existing annotations.
 void addAnnotationList(List annotList, String[] pageRanges, boolean removeExistingAnnots, int measurementUnit)
          Adds specified list of annotations to specified pages at locations in specified measurement unit, and also remove or keep existing annotations in the document.
 void addAnnotationList(List annotList, String[] pageRanges, int measurementUnit)
          Adds specified list of annotations to specified pages at locations in specified measurement unit.
 PdfBookmark addBookmark(int namedAction, String title, PdfBookmark parent)
          Returns a new child bookmark (added under parent) with specified title, and sets the bookmark to perform specified named action.
 PdfBookmark addBookmark(String title, PdfBookmark parent, int pageNo)
          Returns a new child bookmark (added under parent) with specified title, and sets the bookmark to lead to specified page.
 PdfBookmark addBookmark(String title, PdfBookmark parent, int pageNo, double left, double top, double zoom)
          Returns a new child bookmark (added under parent) with specified title, and sets the bookmark to lead to specified location on specified page with specified zoom.
 PdfBookmark addBookmark(String title, PdfBookmark parent, int pageNo, double x, double y, double width, double height)
          Returns a new child bookmark (added under parent), and sets the bookmark's destination to a rectangular area with specified top-left corner (x, y), width and height.
 PdfBookmark addBookmark(String title, PdfBookmark parent, int pageNo, double pos, int fit)
          Returns a new child bookmark (added under parent), and sets the bookmark's destination specified by pageNo, pos and fit.
 PdfBookmark addBookmark(String title, PdfBookmark parent, int pageNo, int fit)
          Returns a new child bookmark (added under parent) with specified title, and sets the bookmark's destination specified by pageNo and fit.
 PdfBookmark addBookmark(String title, PdfBookmark parent, int pageNo, PdfRect rect)
          Returns a new child bookmark (added under parent) with specified title and sets the bookmark to lead to specified rectanglular area on specified page.
 PdfBookmark addBookmark(String title, PdfBookmark parent, int pageNo, Rectangle rect)
          Returns a new child bookmark (added under parent) with specified title, and sets the bookmark to lead to specified rectangular area on specified page.
 PdfBookmark addBookmark(String title, PdfBookmark parent, String applicationToLaunch, boolean print)
          Adds a new child bookmark (under parent), and sets it to launch a specified application or print a specified file.
 PdfBookmark addBookmark(String title, PdfBookmark parent, String javascriptOrURI, int actionType)
          Adds a new child bookmark (under parent) and sets it execute a Javascript script or resolve a URI (Uniform Resource Identifier).
 PdfBookmark addBookmark(String title, PdfBookmark parent, String pdfFileName, int pageNo, boolean newWindow)
          Returns a new child bookmark (added under parent), and sets it to open a specified page on a specified PDF document in the same window or a new window of the viewer.
 void addDefaultFormFont(PdfFont font)
           
 void addDefaultFormFontList(List fontList)
           
 void addFooterImage(PdfImage img, int position, boolean underlay, String pageRange)
          Adds PdfImage object to footer of pages in specified page range.
 void addFooterImage(String path, int position, boolean underlay, String pageRange)
          Adds image, specified by its pathname, to footer of pages in specified page range.
 void addFooterText(String text, PdfFont font, int position, boolean underlay, String pageRange)
          Adds specified text to footer of pages in specified page range.
 void addFooterText(String text, PdfFont font, PdfRect rect, int alignment, int firstLinePosition, int position, boolean underlay, String pageRange)
          Adds a text footer to a specfied page range with specified font, first-line position, vertical/horizontal alignment, and underlay settings.
 void addFormField(PdfFormField formField, int pageNo)
          Add specified form field to specified page.
 void addFormField(PdfFormField f, String[] pageRanges)
          Adds children of specified form field (radio button group or check box group) to a specified page ranges.
 void addFormFieldList(List formFieldList, int pageNo)
          Add a list of form field to a specified page.
 void addHeaderImage(PdfImage img, int position, boolean underlay, String pageRange)
          Adds a PdfImage object to header of pages in specified page range.
 void addHeaderImage(String path, int position, boolean underlay, String pageRange)
          Adds image, specified by its pathname, to footer of pages in specified page range.
 void addHeaderText(String text, PdfFont font, int position, boolean underlay, String pageRange)
          Adds specified text to header of pages in specified page range.
 void addHeaderText(String text, PdfFont font, PdfRect rect, int alignment, int firstLinePosition, int position, boolean underlay, String pageRange)
          Adds specified text as a header on a specified rectangular area in specified pages with specified font, alignment, first-line position, vertical/horizontal position, and underlay settings.
 void addPageBreak()
          (In document creation mode,) adds a new page and makes it the current page for subsequent rendering operations; (in document reading mode,) makes the next page as the current page for subsequent rendering operations.
 void addPdfDocumentChangeHandler(PdfDocumentChangeHandler pdfDocumentChangeHandler)
          Ensures that the specified user class instance is notified when the document object opens or closes a PDF document.
 void addSignature(PdfSignature pdfSignature)
          Adds specified digital signature to the document.
 void addSignature(String PFXFileName, String PFXPassword, String reason, String location, String contactInfo, int pageNum)
          Adds a hidden signature to the document using digital certificate loaded from specified file.
 void addSignature(String PFXFileName, String PFXPassword, String reason, String location, String contactInfo, int pageNum, Date timeStamp)
          Adds a hidden signature with specified timestamp to the document using digital certificate loaded from specified file.
 void addSignature(String PFXFileName, String PFXPassword, String reason, String location, String contactInfo, int pageNum, Date timeStamp, String fieldName, PdfRect fieldRect)
          Adds a signature form field at specified location and with specified timestamp.
 void addSignature(String PFXFileName, String PFXPassword, String reason, String location, String contactInfo, int pageNum, Date timeStamp, String fieldName, PdfRect fieldRect, Color backgroundColor, PdfFont font)
          Adds a signature form field with specified background color and font.
 void addSignature(String PFXFileName, String PFXPassword, String reason, String location, String contactInfo, int pageNum, Date timeStamp, String fieldName, PdfRect fieldRect, PdfAppearanceStream fieldAppearanceStream)
          Adds a signature form field with specified background color, font and appearance stream.
 void addSignature(String PFXFileName, String PFXPassword, String reason, String location, String contactInfo, int pageNum, String fieldName)
          Adds a hidden signature on specified page with specified field name, reason, location, and contact information.
 void addSignature(String PFXFileName, String PFXPassword, String reason, String location, String contactInfo, int pageNum, String fieldName, PdfRect fieldRect)
          Adds a signature form field at specified location.
 void addSignature(String PFXFileName, String PFXPassword, String reason, String location, String contactInfo, int pageNum, String fieldName, PdfRect fieldRect, Color backgroundColor, PdfFont font)
          Adds a signature form field at specified location with specified background color and font.
 void addTable(PdfTable table, double x, double y, int pageNo)
          Renders a specified table at a specfied location on specified page.
 void addTable(PdfTable table, double x, double y, int pageNo, PdfFont f)
          Renders a specified table at a specfied location on specified page with specified font.
 void addThumbnailImage(String path, int pageNo)
          Adds specified image as thumbnail for specified page.
 void addToFiltersList(int filter)
          Adds a filter to the list of filters used to encode stream objects in this document.
 void addWatermarkImage(PdfImage image, int position, boolean applyPageMargins, double angle, boolean underlay, String pageRange)
          Adds PdfImage object as watermark with its exact position determined by position and applyPageMargins.
 void addWatermarkImage(PdfImage image, int position, double angle, boolean underlay, String pageRange)
          Adds PdfImage object as watermark on pages in specified page range.
 void addWatermarkImage(String path, int position, boolean applyPageMargins, double angle, boolean underlay, String pageRange)
          Adds image, specified by its pathname, as watermark with its exact position determined by position and applyPageMargins on pages in specified page range.
 void addWatermarkImage(String path, int position, double angle, boolean underlay, String pageRange)
          Adds image, specified by its pathname, as watermark on pages in specified page range.
 void addWatermarkText(String text, PdfFont font, int position, boolean applyPageMargins, double angle, boolean underlay, String pageRange)
          Adds specified text as watermark with its exact position determined by position and applyPageMargins on pages in specified page range.
 void addWatermarkText(String text, PdfFont font, int position, double angle, boolean underlay, String pageRange)
          Adds specified text as watermark on pages in specified page range.
 void addWatermarkText(String text, PdfFont font, PdfRect rect, int alignment, int firstLinePosition, int position, double angle, boolean underlay, String pageRange)
          Adds specified text as a watermark to a specified rectangular area on a specified pages with specified font, alignment, first-line position, position, rotation, and underlay settings.
 void appendPagesFrom(PdfDocument d, String pageRange)
          Extracts specified pages from a specified document and then appends them to this document.
 void appendPagesFrom(String path, String pageRange)
          Extracts specified pages from a document (specified by its pathname) and then appends them to this document.
 void attachDocument(PdfFileAttachment fa)
          Adds specified file attachment to the document.
 void attachDocument(String fileName)
          Adds specified file as a document-level attachment.
 void attachDocument(String fileName, boolean compressAttachmentStream)
          Adds specified file as a document-level attachment and compresses it if specified.
 void attachDocument(String attachmentName, byte[] bs)
          Adds file in specified byte array as a document-level attachment.
 void attachDocument(String attachmentName, byte[] bs, boolean compressAttachmentStream)
          Adds file in specified byte array as a document-level attachment and compress it if specified.
 void close()
          Closes loaded document and frees I/O resources associated with it.
 void deleteAnnotations()
          Delete all annotations in this document.
 void deleteAnnotations(int type)
          Delete all annotations of specified type in the document.
 void deleteAnnotationsOnPage(int pageNo)
          Delete all annotations on specified page.
 void deleteAnnotationsOnPage(int pageNo, int type)
          Deletes all annotations of specified in specified page.
 void deleteFormFields()
          Removes all form fields in the document.
 void deleteFormFields(int type)
          Removes all form fields of specified type in the document.
 void deleteFormFields(String name)
          Removes all form fields with specified name in the document.
 void deleteFormFieldsOnPage(int pageNo)
          Removes all form fields on specified page.
 void deleteFormFieldsOnPage(int pageNo, int type)
          Removes all form fields of specified type on specified page.
 void deleteFormFieldsOnPage(int pageNo, String name)
          Removes all form fields with specified name in specified page.
 void deletePages(String pageRange)
          Deletes pages in specified page range from this PdfDocument.
 void disableAllMargins(String pageRange)
          Disables all margins on pages in specified page range.
 void drawArc(PdfRect rect, double startAngle, double arcAngle)
          Draws an arc on the current page of this PdfDocument.
 void drawArc(PdfRect rect, double startAngle, double arcAngle, String pageRange)
          Draws an arc on pages in specified page range.
 void drawBezierCurve(double startX, double startY, double ctrlX, double ctrlY, double endX, double endY, boolean isFill, boolean isStroke)
          Draws a Bézier curve with a single control point on current page of this PdfDocument.
 void drawBezierCurve(double startX, double startY, double ctrlX, double ctrlY, double endX, double endY, boolean isFill, boolean isStroke, String pageRange)
          Draws a Bézier curve with a single control point on pages in specified page range in this PdfDocument.
 void drawBezierCurve(double startX, double startY, double ctrlX1, double ctrlY1, double ctrlX2, double ctrlY2, double endX, double endY, boolean isFill, boolean isStroke)
          Draws a Bézier curve with two control points on current page of this PdfDocument.
 void drawBezierCurve(double startX, double startY, double ctrlX1, double ctrlY1, double ctrlX2, double ctrlY2, double endX, double endY, boolean isFill, boolean isStroke, String pageRange)
          Draws a Bézier curve with two control points on pages in specified page range on this PdfDocument.
 void drawCircle(double x, double y, double radius, boolean isFill, boolean isStroke)
          Draws a circle with specified radius on this PdfDocument's current page.
 void drawCircle(double x, double y, double radius, boolean isFill, boolean isStroke, String pageRange)
          Draws a circle with specified radius on pages in specified page range on this PdfDocument.
 void drawEllipse(double x1, double y1, double x2, double y2, boolean isFill, boolean isStroke)
          Draws an ellipse on this PdfDocument's current page.
 void drawEllipse(double x1, double y1, double x2, double y2, boolean isFill, boolean isStroke, String pageRange)
          Draws an ellipse on pages in specified page range on this PdfDocument's current page.
 void drawImage(PdfImage img, double x, double y)
          Draws specified image at position (x, y) on this PdfDocument's current page.
 void drawImage(PdfImage img, double x, double y, boolean scaleToFit, boolean stretch)
          Renders specified image at position (x, y) with specified stretching and aspect ratio settings on the document's current page.
 void drawImage(PdfImage img, double x, double y, boolean scaleToFit, boolean stretch, String pageRange)
          Renders specified image at position (x, y) with specified stretching and aspect ratio settings on specified pages.
 void drawImage(PdfImage img, double x, double y, double rotation)
          Draws specified image rotated by rotation degrees at position (x, y) on this PdfDocument's current page.
 void drawImage(PdfImage img, double x, double y, double width, double height)
          Draws specified image at position (x, y) with specified height and width on this PdfDocument's current page.
 void drawImage(PdfImage img, double x, double y, double width, double height, double rotation)
          Draws specified image rotated by rotation degrees at position (x, y) with specified height and width on this PdfDocument's current page.
 void drawImage(PdfImage img, double x, double y, double width, double height, double rotation, String pageRange)
          Draws specified image rotated by rotation degrees at position (x, y) with specified height and width on pages in specified page range.
 void drawImage(PdfImage img, double x, double y, double width, double height, String pageRange)
          Draws specified image at position (x, y) with specified height and width on pages in specified page range.
 void drawImage(PdfImage img, double x, double y, double rotation, String pageRange)
          Draws specified image rotated by rotation degrees at position (x, y) on pages in specified page range.
 void drawImage(PdfImage img, double x, double y, String pageRange)
          Draws specified image at position (x, y) on pages in specified page range.
 void drawImage(PdfImage img, PdfPoint pt)
          Draws specified image at specified point on this PdfDocument's current page.
 void drawImage(PdfImage img, PdfPoint pt, double rotation)
          Draws specified image rotated by rotation degrees at specified point on this PdfDocument's current page.
 void drawImage(PdfImage img, PdfPoint pt, double width, double height)
          Draws specified image at specified point with specified width and height on this PdfDocument's current page.
 void drawImage(PdfImage img, PdfPoint pt, double width, double height, double rotation)
          Draws specified image rotated by rotation degrees at specified point on this PdfDocument's current page.
 void drawImage(PdfImage img, PdfPoint pt, double width, double height, double rotation, String pageRange)
          Draws specified image rotated by rotation degrees at specified point with specified width and height on pages in the specified page range.
 void drawImage(PdfImage img, PdfPoint pt, double width, double height, String pageRange)
          Draws specified image at specified point with specified width and height on pages in the specified page range.
 void drawImage(PdfImage img, PdfPoint pt, double rotation, String pageRange)
          Draws specified image rotated by rotation degrees at specified point on pages in the specified page range.
 void drawImage(PdfImage img, PdfPoint pt, String pageRange)
          Draws specified image at specified point on pages in specified page range.
 void drawImage(PdfImage img, PdfRect rect)
          Draws specified image inside specified rectangle on this PdfDocument's current page.
 void drawImage(PdfImage img, PdfRect rect, double rotation)
          Draws specified image rotated by rotation degrees inside specified rectangle on this PdfDocument's current page.
 void drawImage(PdfImage img, PdfRect rect, double rotation, String pageRange)
          Draws specified image rotated by rotation degrees inside specified rectangle on pages in specified range.
 void drawImage(PdfImage img, PdfRect rect, String pageRange)
          Draws specified image inside specified rectangle on pages in specified page range.
 void drawImage(String path, double x, double y)
          Draws image specified by its pathname at position (x, y) on this PdfDocument's current page.
 void drawImage(String path, double x, double y, double rotation)
          Draws image specified by its pathname rotated at rotation degrees at position (x, y) on this PdfDocument's current page.
 void drawImage(String path, double x, double y, double width, double height)
          Draws image specified by its pathname at position (x, y) with specified width and height on this PdfDocument's current page.
 void drawImage(String path, double x, double y, double width, double height, double rotation)
          Draws image specified by its pathname rotated by rotation degrees at position (x, y) with specified width and height on this PdfDocument's current page.
 void drawImage(String path, double x, double y, double width, double height, double rotation, String pageRange)
          Draws image specified by its pathname rotated by rotation degrees at position (x, y) with specified width and height on pages in specified page range.
 void drawImage(String path, double x, double y, double width, double height, String pageRange)
          Draws image specified by its pathname at position (x, y)with specified width and height on pages in specified page range.
 void drawImage(String path, double x, double y, double rotation, String pageRange)
          Draws image specified by its pathname rotated by rotation degrees at position (x, y)on pages in specified range.
 void drawImage(String path, double x, double y, String pageRange)
          Draws image specified by its pathname at position (x, y) on pages in specified page range.
 void drawImage(String path, PdfPoint pt)
          Draws image specified by its pathname at specified point on this PdfDocument's current page.
 void drawImage(String path, PdfPoint pt, double rotation)
          Draws image specified by its pathname rotated by rotation degrees at specified point on this PdfDocument's current page.
 void drawImage(String path, PdfPoint pt, double width, double height)
          Draws image specified by its pathname at specified point with specified width and height on this PdfDocument's current page.
 void drawImage(String path, PdfPoint pt, double width, double height, double rotation)
          Draws image specified by its pathname rotated by rotation degrees at specified point with specified width and height on this PdfDocument's current page.
 void drawImage(String path, PdfPoint pt, double width, double height, double rotation, String pageRange)
          Draws image specified by its pathname rotated by rotation degrees at specified position with specified width and height on pages in specified page range.
 void drawImage(String path, PdfPoint pt, double width, double height, String pageRange)
          Draws image specified by its pathname at specified position with specified width and height on pages in specified range.
 void drawImage(String path, PdfPoint pt, double rotation, String pageRange)
          Draws image specified by its pathname rotated by rotation degrees at specified point on pages in specified range.
 void drawImage(String path, PdfPoint pt, String pageRange)
          Draws image specified by its pathname at specified point on pages in specified page range.
 void drawImage(String path, PdfRect rect)
          Draws image specified by its pathname inside specified rectangle on this PdfDocument's current page.
 void drawImage(String path, PdfRect rect, double rotation)
          Draws image specified by its pathname rotated by rotation degrees inside specified rectangle on this PdfDocument's current page.
 void drawImage(String path, PdfRect rect, double rotation, String pageRange)
          Draws image specified by its pathname rotated by rotation degrees inside specified rectangle on pages in specified page range.
 void drawImage(String path, PdfRect rect, String pageRange)
          Draws image specified by its pathname inside specified rectangle on pages in specified page range.
 void drawLine(double startx, double starty, double endx, double endy)
          Draws a line between position (startx, starty) and (endx, endy) on this PdfDocument's current page.
 void drawLine(double startx, double starty, double endx, double endy, String pageRange)
          Draws a line between position (startx, starty) and (endx, endy) on pages in specified page range.
 void drawLine(PdfPoint start, PdfPoint end)
          Draws a line from start to end on this PdfDocument's current page.
 void drawLine(PdfPoint start, PdfPoint end, String pageRange)
          Draws a line from start to end on pages in specified page range.
 void drawPie(double x, double y, double width, double height, double startAngle, double arcAngle, boolean isFill, boolean isStroke, String pageRange)
          Draws a pie segment on pages in specified page range.
 void drawPie(int x, int y, int width, int height, double startAngle, double arcAngle, boolean isFill, boolean isStroke)
          Draws a pie segment on this PdfDocument's current page.
 void drawPolygon(double[] xPoints, double[] yPoints, int nPoints, boolean isFill, boolean isStroke)
          Draws a polygon on this PdfDocument's current page.
 void drawPolygon(double[] xPoints, double[] yPoints, int nPoints, boolean isFill, boolean isStroke, String pageRange)
          Draws a polygon on pages in specified page range.
 void drawPolyline(double[] xPoints, double[] yPoints, int nPoints)
          Draws a polyline on this PdfDocument's current page.
 void drawPolyline(double[] xPoints, double[] yPoints, int nPoints, String pageRange)
          Draws a polyline on pages in specified page range.
 void drawRect(double x, double y, double width, double height)
          Draws a rectangle at position (x, y) with specified width and height on this PdfDocument's current page.
 void drawRect(double x, double y, double width, double height, boolean isFill, boolean isStroke)
          Draws a rectangle on this PdfDocument's current page at position (x, y) with specified width, height, pen, and brush settings.
 void drawRect(double x, double y, double width, double height, boolean isFill, boolean isStroke, String pageRange)
          Draws a rectangle on pages in specified page range page at position (x, y) with specified width, height, brush, and pen settings.
 void drawRect(double x, double y, double width, double height, String pageRange)
          Draws a rectangle at position (x, y) with specified width and height on pages in specified page range.
 void drawRect(PdfRect r)
          Draws rectangle r on this PdfDocument's current page.
 void drawRect(PdfRect r, String pageRange)
          Draws specified PdfRect object on pages in specified page range.
 void drawRect(Rectangle r)
          Draws specified Rectangle object on this PdfDocument's current page.
 void drawRect(Rectangle r, String pageRange)
          Draws specified Rectangle object on pages in specified page range.
 void drawRoundRect(double x, double y, double width, double height, double arcWidth, double arcHeight, boolean isFill, boolean isStroke)
          Draws a rectangle with rounded corners on this PdfDocument's current page.
 void drawRoundRect(double x, double y, double width, double height, double arcWidth, double arcHeight, boolean isFill, boolean isStroke, String pageRange)
          Draws a rectangle with rounded corners on pages in specified page range.
 void drawSquare(double x, double y, double length)
          Draws a square on this PdfDocument's current page.
 void drawSquare(double x, double y, double length, boolean isFill, boolean isStroke)
          Draws a square with specified brush and pen settings on this PdfDocument's current page.
 void drawSquare(double x, double y, double length, boolean isFill, boolean isStroke, String pageRange)
          Draws a square with specified pen and brush settings on pages in specified page range.
 void drawSquare(double x, double y, double length, String pageRange)
          Draws a square on pages in specified page range.
 void embedFont(PdfFont fontToBeEmbedded)
          Embeds specified font in the document.
 void embedFont(PdfFont fontToBeEmbedded, String originalFont)
          Embeds specified font in place of another font already existing in the document.
 void enableAllMargins(String pageRange)
          Enables all margins on pages in specified page range.
 void enumPageElements(int pageNum, int elementTypes, PdfEnumPageElementsHandler pdfEnumPageElementsHandler)
          Parse contents of specified page and call onEnumPageElements() event handler of specified user-class instance whenever a page element of specified type is encountered.
 void enumPageElements(String pageRange, int elementTypes, PdfEnumPageElementsHandler pdfEnumPageElementsHandler)
          Parse contents of specified pages and call onEnumPageElements() event handler of specified user-class instance whenever a page element of specified type is encountered.
 void exportToFDF(File fdfFile)
          Writes interactive forms data of the PDF document to an FDF (Forms Data Format) file.
 void extractPagesTo(String path, String pageRange)
          Extracts pages in specified page range and places them in a file specified by its pathname.
 void extractPagesTo(String path, String pageRange, String extractAsVersion, boolean openAfterExtraction)
          Extracts pages in specified page range in specified PDF version and places them in a new file specified by its pathname.
 List extractText(int pageNum)
          Returns a list containing lines of text extracted from specified page.
 List extractText(String pageRange, boolean insertPageBreak)
          Returns a list containing lines of text extracted from specified pages.
 PdfSearchElement findFirst(String searchString, int searchMode, int searchOptions, int startPageNum, boolean isSearchForward)
          Returns first page element that is found for the search for specified text.
 PdfSearchElement findNext(PdfSearchElement currentSearchElement)
          Returns page element found by the search operation immediately after specified search element.
 PdfSearchElement findPrevious(PdfSearchElement currentSearchElement)
          Returns page element found by the search operation immediately prior to specified search element.
 void flattenFormFields()
          Flattens all form fields in the document.
 void flattenFormFields(boolean flattenWithNewValue)
          Flattens all form fields with or without retaining new values.
 void flattenFormFields(int type)
          Flatens form fields of specified type.
 void flattenFormFields(int type, boolean flattenWithNewValue)
          Flattens a form field of specified type with or without retaining new values.
 void flattenFormFields(String name)
          Flattens form fields with specified name.
 void flattenFormFields(String name, boolean flattenWithNewValue)
          Flattens form fields having specified name with or without retaining new values.
 void flattenFormFieldsOnPage(int pageNo)
          Flattens all form fields on specified page.
 void flattenFormFieldsOnPage(int pageNo, boolean flattenWithNewValue)
          Flatten form fields on specified page with or without retaining new values.
 void flattenFormFieldsOnPage(int pageNo, int type)
          Flatten form fields of specified type in specified page.
 void flattenFormFieldsOnPage(int pageNo, int type, boolean flattenWithNewValue)
          Flattens form fields of specified type on specified page with or without retaining new values.
 void flattenFormFieldsOnPage(int pageNo, String name)
          Flattens form fields with specified name on specified page.
 void flattenFormFieldsOnPage(int pageNo, String name, boolean flattenWithNewValue)
          Flattens all form fields with specified name on specified page with or without applying new values.
 List getAllAnnotations()
          Returns a list of all annotations in the document.
 List getAllAnnotations(int type)
          Get all annotations of specified type.
 void getAllAnnotations(int type, List listToPopulate)
          Populates a specified list with all annotations of specified type in the document.
 void getAllAnnotations(List listToPopulate)
          Populates a specified list with all annotations in the document.
 List getAllAnnotationsOnPage(int pageNo)
          Returns a list of all annotations in specified page.
 List getAllAnnotationsOnPage(int pageNo, int type)
          Returns a list of annotations of specified type in specified page.
 void getAllAnnotationsOnPage(int pageNo, int type, List listToPopulate)
          Populates a specified list with all annotations of specified type in a specified page.
 void getAllAnnotationsOnPage(int pageNo, List listToPopulate)
          Populates a specified list with all annotations in a specified page.
 List getAllEmbededFontNames()
          Returns a list of names of all embedded fonts in the document.
 List getAllFontBaseNames()
          Returns a list of base names of all fonts used in the document.
 List getAllFontBaseNames(String pageRange)
          Returns a list of basenames of all fonts used in pages in the specified page range.
 List getAllFormFields()
          Returns a list of all form fields in the document.
 List getAllFormFields(int type)
          Returns a list of all form fields of specified type.
 List getAllFormFields(String name)
          Returns a list of all form fields with specified name.
 List getAllFormFieldsOnPage(int pageNo)
          Returns a list of all form fields on specified page.
 List getAllFormFieldsOnPage(int pageNo, int type)
          Returns a list of all form fields in specified page.
 List getAllFormFieldsOnPage(int pageNo, String name)
          Populates a list of all form fields with specified name in specified page.
 ArrayList getAttachments()
          Returns a list of file attachments in the document.
 String getAuthor()
          Returns "author" document property of this document.
 PdfBookmark getBookmarkRoot()
          Returns a PdfBookmark object that points to the root of the bookmark tree of this PdfDocument.
 Color getBrushColor()
          Returns default fill color for content-rendering operations on the document.
 int getCompressionLevel()
          Returns constant identifying compression level of this Pdfdocument.
 Date getCreationDate()
          Returns "creation date" document property for this property.
 String getCreator()
          Returns "creator" document information property of the document.
 int getDefaultFieldAlignment()
          Returns default text alignment for form fields in the document.
 Color getDefaultFormFontColor()
          Returns default color for form field text in the document.
 List getDefaultFormFontList()
           
 PdfEncryption getEncryptor()
          Retrieves current encryption settings of this PdfDocument.
 PdfBookmark getFirstBookmark()
          Returns first bookmark in this PdfDocument's document outline.
 PdfFont getFont()
          Returns default font used to render text elements in the document.
 String getInputFileName()
          Returns name of the file from which the document was loaded.
 String getInputFilePath()
          Returns parent directory path of the file from which this document was loaded.
 String getKeywords()
          Returns "keywords" document property of the document.
 int getMeasurementUnit()
          Returns default measurement unit currently in use for this PdfDocument.
 Date getModifiedDate()
          Return "modified date" documentation property of this document.
 PdfPage getPage(int pageNo)
          Returns a PdfPage object specified by page number in this document.
 BufferedImage getPageAsBufferedImage(int pageNum)
          Returns a buffered image of the contents of specfied page.
 BufferedImage getPageAsBufferedImage(int pageNum, int scaleToResolution, double zoomPercentage, int rotationAngle)
           
 BufferedImage getPageAsBufferedImage(int pageNum, int width, int height)
          Returns a buffered image (with specified width and height) of the contents of specfied page.
 BufferedImage getPageAsBufferedImage(int pageNum, int width, int height, int scaleToResolution)
          Returns a buffered image (with specified width and height) of the contents of specfied page scaled to a specified resolution.
 BufferedImage getPageAsBufferedImage(int pageNum, int width, int height, int scaleToResolution, double zoom)
           
 BufferedImage getPageAsBufferedImage(int pageNum, int width, int height, int bufferedImageType, int scaleToResolution)
          Returns a buffered image of specified type (with specified width and height) of the contents of specfied page scaled to a specified resolution.
 BufferedImage getPageAsBufferedImage(int pageNum, int width, int height, int bufferedImageType, int scaleToResolution, double zoom)
           
 int getPageCount()
          Returns number of pages in this PdfDocument.
 List getPageElements(int pageNum, int elementTypes)
          Returns a list of page elements of specified type in specified page.
 List getPageElements(String pageRange, int elementTypes)
          Returns list of all page elements of specified type in specified page range.
 int getPageLayout()
          Returns constant identifying page layout used as default when opening this document.
 int getPageMode()
          Returns constant identifying this PdfDocument's default page mode.
 List getPdfFileAttachments()
          Returns a list of file attachments in the document.
 Color getPenColor()
          Returns default stroking color for content-rendering operations on the pages of the document.
 String getProducer()
          Returns "producer" document property of the document.
 PdfReader getReader()
          Deprecated. No replacement
 PdfRenderErrorHandler getRenderErrorHandler()
          Returns current user-class instance whose onRenderError() event handler has been set to be called by this document object.
 PdfRenderingOptions getRenderingOptions()
          Returns current rendering options of the document.
 String getSubject()
          Returns "subject" document property of the document.
 String[] getSupportedCompressionTypes(String format)
          Returns a list of compression methods used for specified image format.
 String getTitle()
          Returns "title" document property of the document.
 String getVersion()
          Returns constant identifying this PdfDocument's PDF version.
 int getViewerPreferences()
          Returns viewer application preferences of this document.
 PdfWriter getWriter()
          Deprecated. No replacement
 File getWriterOutputFile()
          Returns output file specified for this document.
 String getXMLMetadata()
          Returns XML metadata of this PdfDocument.
 void importFromFDF(File fileName)
          Save interactive forms data imported from a specified FDF (Forms Data Format) file.
 void insertPagesFrom(com.gnostice.pdfone.PdfStdDocument d, String pageRange, int insertAfterPage)
          Insert specified pages from a specified document at specified page position in this document.
 void insertPagesFrom(String path, String pageRange, int insertAfterPage)
          Insert specified pages from a document (specified by its pathname) at specified page position in this document.
 boolean isAutoAdjustFieldTextHeight()
          Returns whether the size of text inside text box, list box and combo box form fields will be adjusted by the viewer application so that the text is fully accommodated inside the fields without any cropping.
 boolean isAutoPaginate()
          Returns whether content-rendering operations are set to paginate automatically.
 boolean isEncrypted()
          Returns whether the document is encrypted.
 boolean isImageFomatandCompressionLossless(String imageFormat, String compressionType)
          Returns whether specified compresion method for specified image format is lossless.
 boolean isLoaded()
           
 boolean isOpenAfterSave()
          Returns whether document is set to be executed after data is saved to file.
 boolean isOverrideFieldAppearanceStreams()
          Returns whether text associated with all form fields in the document are by default displayed by viewer applications.
 boolean isPrintAfterSave()
           
 void load(byte[] byteArray)
          Loads a PDF document from a byte array.
 void load(File inFile)
          Loads PDF document specified by a java.io.File object.
 void load(FileInputStream fileInputStream)
          Loads PDF document specified by a java.io.FileInputStream object.
 void load(InputStream inputStream)
           
 void load(String strFilePath)
          Loads PDF document in specified path.
 void merge(List docList)
          Merges this document with documents in specified list.
 void merge(List docList, int mergeOptions)
          Merges this document with documents in specified list using specified merging options.
 void merge(PdfDocument d)
          Merges this document with another document.
 void merge(PdfDocument d, int mergeOptions)
          Merges this document with another document using specified merging options.
 void merge(String path)
          Merges this document with a document specified by its pathname.
 void merge(String path, int mergeOptions)
          Merges this document with a document (specified by its pathname) using specified merging options.
 void redactRegion(String pageRange, PdfRect boundingRect, boolean includeIntersectingText, boolean clipRegion, PdfPen pen, PdfBrush brush, boolean isStroke, boolean isFill)
          Redact all text within specified rectangle and if required remove even characters that fall partially outside the rectangle.
 void redactRegion(String pageRange, PdfRect boundingRect, boolean clipRegion, PdfPen pen, PdfBrush brush, boolean isStroke, boolean isFill)
          Redacts all text in specified region in specified pages.
 void redactText(int pageNum, String searchString, int searchMode, int searchOptions)
          Redacts all instances of specified text in specified page.
 void redactText(int pageNum, String searchString, int searchMode, int searchOptions, PdfPen pen, PdfBrush brush, boolean isStroke, boolean isFill)
          Redacts all instances of specified text in specified page and fills/strokes the redacted region if specified.
 void redactText(String pageRange, String searchString, int searchMode, int searchOptions)
          Redacts all instances of specified text in specified pages.
 void redactText(String pageRange, String searchString, int searchMode, int searchOptions, PdfPen pen, PdfBrush brush, boolean isStroke, boolean isFill)
          Redacts all instances of specified text in specified pages and fills/strokes the region if specified.
 void removeAllAttachments()
          Deletes all attachments in the document.
 void removeAllAttachments(String attachmentName)
          Deletes all attachments with specified name in the document.
 void removeAllSignaures()
          Remove all signatures from the document.
 void removeBookmarkRoot()
          Removes all bookmarks existing in the document.
 boolean removePdfDocumentChangeHandler(PdfDocumentChangeHandler pdfDocumentChangeHandler)
          Ensures that the onLoad() and onClose() event handlers of specified user-class instance are no longer.
 void removeThumbnailImage(String pageRange)
          Removes thumbnail image for specified pages.
 void renderOnGraphics(int pageNum, Graphics g)
          Renders contents of specified page on specified graphics object.
 void renderOnGraphics(int pageNum, Graphics g, double x, double y, double width, double height)
          Renders contents of specified page on a rectangular area (specified by coordinates of its top left corner, its height and its width) inside a specified graphics item.
 void renderOnGraphics(int pageNum, Graphics g, Point2D position, double zoom)
          Renders contents of specified page at a particular position on a specified graphics item with specified magnification of the page contents.
 void renderOnGraphics(int pageNum, Graphics g, Point2D position, double xZoom, double yZoom)
          Renders contents of specified page at specified position on specified graphics item with specified magnification of height and width of the page contents.
 void renderOnGraphics(int pageNum, Graphics g, Point2D position, double xZoom, double yZoom, double rotation, double pointOfRotationAboutWidth, double pointOfRotationAboutHeight)
          Renders contents of specified page at specified position on specified graphics item with specified resolution, and magnification of width and height of the page contents.
 void renderOnGraphics(int pageNum, Graphics g, Point2D position, double xZoom, double yZoom, int scaleToResolution)
          Renders contents of specified page at specified position on specified graphics item with specified resolution, and magnification of width and height of the page contents.
 void renderOnGraphics(int pageNum, Graphics g, Rectangle2D rect)
          Renders contents of specified page on a specified rectangular area on a specified graphics item.
 void replaceAllEmbeddedFonts(PdfFont replaceWithFont)
          Replaces all embedded fonts with specified font.
 void replaceEmbeddedFont(String embeddedFontBaseName, PdfFont replaceWithFont)
          Replace specified embedded font with another specified font.
 long save(File outFile)
          Save loaded document to specified file object.
 long save(OutputStream outputStream)
          Save loaded document to specified output stream object.
 long save(String outFilePath)
          Save loaded document with specified pathname.
 void saveAsImage(String format, String pageRange, String imageName, float compressionQuality, String outputPath)
          Saves an image of specified pages in specified format with specified pathname, and compression quality.
 void saveAsImage(String format, String pageRange, String imageName, float compressionQuality, String outputPath, int scaleToResolution)
          Saves an image of specified pages in specified format with specified pathname, compression quality and resolution.
 void saveAsImage(String format, String pageRange, String imageName, float compressionQuality, String outputPath, int scaleToResolution, double zoom)
           
 void saveAsImage(String format, String pageRange, String imageName, float compressionQuality, String compressionType, String outputPath, int scaleToResolution, double zoom)
           
 void saveAsImage(String format, String pageRange, String imageName, int imageWidth, int imageHeight, float compressionQuality, String outputPath)
          Saves image of specified pages in specified format with specified pathname, width, height, compression type and compression quality.
 void saveAsImage(String format, String pageRange, String imageName, int imageWidth, int imageHeight, float compressionQuality, String outputPath, int scaleToResolution)
          Saves image of specified pages in specified format with specified pathname, width, height, compression type, compression quality, and DPI.
 void saveAsImage(String format, String pageRange, String imageName, int imageWidth, int imageHeight, float compressionQuality, String compressionType, String outputPath, int scaleToResolution)
           
 void saveAsImage(String format, String pageRange, String imageName, String outputPath)
          Saves rasterized image of specified pages in specified format with specified pathname.
 void saveAsImage(String format, String pageRange, String imageName, String outputPath, int scaleToResolution)
          Saves rasterized image of specified pages in specified format with specified pathname and resolution.
 void saveAsImage(String format, String pageRange, String imageName, String imageWidth, String imageHeight, float compressionQuality, String outputPath)
          Saves image of specified pages in specified format with specified pathname, width, height, and compression level.
 void saveAsImage(String format, String pageRange, String imageName, String imageWidth, String imageHeight, float compressionQuality, String outputPath, int scaleToResolution)
          Saves image of specified pages in specified format with specified pathname, width, height, compression level, and resolution.
 void saveAsText(int pageNum, Writer writer)
          Exports all text of specified page and saves it to specified writer instance.
 void saveAsText(int pageNum, Writer writer, boolean ignoreExtraNewLines)
          Exports all text (after ignoring extra blank lines) of specified page and saves it to specified writer instance.
 void saveAsText(String pageRange, Writer writer, boolean insertPageBreak)
          Exports all text of specified pages and saves it to specified writer instance (after ignoring extra blank lines).
 void saveAsText(String pageRange, Writer writer, boolean insertPageBreak, boolean ignoreExtraNewLines)
          Exports all text from specified pages (excluding consecutive blank lines and including a new line for each new page) and writes to the specified text writer object.
 void saveDocAsTiffImage(String filePath)
          Exports the document as a multi-page TIFF image with specified pathname.
 void saveDocAsTiffImage(String filePath, int scaleToResolution)
          Exports the document as a multi-page TIFF image with specified pathname and resolution.
 void saveDocAsTiffImage(String filePath, int tiffCompressionType, float tiffCompressionQuality)
          Exports the document as a multi-page TIFF image with specified pathname, compression type, and compression quality.
 void saveDocAsTiffImage(String filePath, int tiffCompressionType, float tiffCompressionQuality, int scaleToResolution)
          Exports the document as a multi-page TIFF image with specified pathname, compression type, compression quality, and resolution.
 void saveDocAsTiffImage(String pageRange, String filePath)
          Exports specified pages as a multi-page TIFF image with specified pathname.
 void saveDocAsTiffImage(String pageRange, String filePath, int scaleToResolution)
          Exports specified pages as a multi-page TIFF image with specified pathname and resolution.
 void saveDocAsTiffImage(String filePath, String pageRange, int tiffCompressionType, float tiffCompressionQuality)
          Exports specified pages as a multi-page TIFF image with specified pathname, compression type, and compression quality.
 void saveDocAsTiffImage(String filePath, String pageRange, int tiffCompressionType, float tiffCompressionQuality, int scaleToResolution)
          Exports specified pages as a multi-page TIFF image with specified pathname, compression type, compression quality and resolution.
 void saveDocAsTiffImage(String filePath, String pageRange, int tiffCompressionType, float tiffCompressionQuality, int scaleToResolution, double zoom)
          Exports specified pages as a multi-page TIFF image with specified pathname, compression type, compression quality, scaling, and magnification.
 void saveDocAsTiffImage(String filePath, String pageRange, int width, int height, int tiffCompressionType, float tiffCompressionQuality, int scaleToResolution)
          Exports specified pages as a multi-page TIFF image with specified pathname, widht, height, compression type, compression quality, scaling.
 List search(int startPageNum, String searchString, int searchMode, int searchOptions)
          Returns a list of all lines of text that contain specified search text string (in and after specified page).
 List search(List searchStringList, int pageNum, int searchMode, int searchOptions)
           
 List search(List searchStringList, String pageRange, int searchMode, int searchOptions)
           
 List search(String searchString, int pageNum, int searchMode, int searchOptions)
          Returns all lines of text that contains specified search string in specified page.
 void search(String searchString, int searchMode, int searchOptions, PdfSearchHandler pdfSearchHandler, int startPageNum)
          Searches specified search string in specified page and calls onSearchElement() event handler of specified user-class instance when a line containing specified search text string is found.
 void search(String searchString, int searchMode, int searchOptions, PdfSearchHandler pdfSearchHandler, String pageRange)
           
 List search(String searchString, String pageRange, int searchMode, int searchOptions)
           
 void setAuthor(String s)
          Specifies "author" document property for this document.
 void setAutoAdjustFieldTextHeight(boolean autoAdjustFieldTextHeight)
          Specifies whether the size of text inside text box, list box and combo box form fields needs to be adjusted by the viewer application so that the text is fully accommodated inside the fields without any cropping.
 void setAutoPageCreationHandler(PdfAutoPageCreationHandler autoPageCreationHandler)
          Ensures that the onAutoPageCreation() event handler of specified user-class instance is called when a new page is automatically created to accommodate a content-rendering operation.
 void setAutoPaginate(boolean autoPaginate)
          Specifies whether content-rendering operations need to paginate automatically.
 void setBrushColor(Color c)
          Specifies default color for this PdfDocument's brush.
 void setCompressionLevel(int compressionLevel)
          Specifies compression level for this PdfDocument.
 void setCph(PdfCustomPlaceholderHandler cph)
          Ensures that the onCustomPlaceHolder() event handler is called for the specified user-class instance when a custom placeholder is encountered in a text-rendering operation.
 void setCreationDate(Date date)
          Sets "creation date" document information property.
 void setCreator(String s)
          Set specified "creator" document information property for this document.
 void setCropBox(double cropLeft, double cropTop, double cropRight, double cropBottom, int unit, String pageRange)
          Sets crop box of specified pages in specified measurement unit.
 void setCropBox(double cropLeft, double cropTop, double cropRight, double cropBottom, String pageRange)
          Sets crop box of specified pages.
 void setCropBox(PdfRect rect, int unit, String pageRange)
          Set specified rectangular area in specified measurement unit as the crop box for specified pages.
 void setCropBox(PdfRect rect, String pageRange)
          Sets specified rectangular area as the crop box for specified pages.
 void setDefaultFieldAlignment(int defualtFieldAlignment)
          Specifies default text alignment for form fields in the document.
 void setDefaultFormFontColor(Color defaultFormFontColor)
          Specifies default color for form field text in the document.
 void setDefaultFormFontIndex(int defaultFormFontIndex)
           
 void setDefaultFormFontList(List fontList)
           
 void setEncryptor(PdfEncryption encrypto)
          Specify encryption settings for this PdfDocument.
 void setFont(PdfFont defaultFont)
          Specifies default font that needs to be used to render text elements in the document.
 void setKeywords(String s)
          Specifies "keywords" document property for this document.
 void setMeasurementUnit(int measurementUnit)
          Specifies default measurement unit to be used for this PdfDocument.
 void setModifiedDate(Date date)
          Set "modified date" document information property.
 void setOnBookmarkMerge(PdfBookmarkMergeHandler onBookmarkMerge)
          Ensures that the onBookmarkMerge() event handler of specified user-class instance is called when the bookmark tree of another document is merged with that of this document.
 void setOnNeedFileName(PdfNeedFileNameHandler pnfnh)
          Ensures that the onNeedFileName() event handler of specified user-class instance is called when this document is being split and a splinter document is created.
 void setOnPageReadHandler(PdfPageReadHandler onPageReadHandler)
          Ensures that the onPageRead() event handler of specified user-class instance is called when a new page is read from the document.
 void setOnPasswordHandler(PdfPasswordHandler onPasswordHandler)
          Ensures that onPassword() event handler of specified user-class instance is called when a password is required to read a document.
 void setOnRenameField(PdfFormFieldRenameHandler pfrh)
          Ensures that the onRenameField() event handler of specified user-class instance is called when a duplicate field is encountered in a document-merge operation.
 void setOpenAfterSave(boolean openAfterSave)
          Specifies whether document needs to be launched by the Operating System (OS) shell program (such as explorer.exe in Windows) after it is saved to a file.
 void setOverrideFieldAppearanceStreams(boolean overrideAppearanceStreams)
          Specifies whether text associated with all form fields in the document need to be displayed by default.
 void setPageLayout(int value)
          Specifies default page layout to be used when opening this document.
 void setPageMode(int value)
          Specifies default page mode with which this PdfDocument needs to be opened.
 void setPenCapStyle(int capStyle)
          Specifies default shape of endpoints of paths in this PdfDocument.
 void setPenColor(Color color)
          Specifies default color for this PdfDocument's pen.
 void setPenDashGap(double gap)
          Specifies length of gaps in default dash pattern of this PdfDocument's pen.
 void setPenDashLength(double length)
          Specifies length of dashes in default dash pattern of this PdfDocument's pen.
 void setPenDashPhase(double phase)
          Specifies length of phase of default dash pattern of this PdfDocument's pen.
 void setPenJoinStyle(int joinStyle)
          Specifies default shape of joints of paths that connect at an angle for this PdfDocument's pen.
 void setPenMiterLimit(int limit)
          Specifies default miter limit for this PdfDocument's pen.
 void setPenWidth(double width)
          Specifies default width for this PdfDocument's pen.
 void setPrintAfterSave(boolean printAfterSave)
          Specifies whether the document needs to be sent to a printer for printing after it is saved to a file.
 void setProducer(String s)
          Deprecated. No replacement
 void setReader(PdfReader r)
          Deprecated. No replacement
 void setRenderErrorHandler(PdfRenderErrorHandler pdfRenderErrorHandler)
          Ensures that the onRenderError() event handler of specified user-class instance is called whenever a rendering error occurs.
 void setRenderingOptions(PdfRenderingOptions renderingOptions)
          Set specified rendering options for the document.
 void setSaveAsImageHandler(PdfSaveAsImageHandler saveAsImageHandler)
          Ensures that the onSaveAsImage() event handler of specified user-class instance is called whenever a page is exported as an image.
 void setSubject(String s)
          Specifies "subject" document property for this document.
 void setTitle(String s)
          Specifies "title" document property for this document.
 void setVersion(String version)
          Specifies PDF version of this PdfDocument.
 void setViewerPreferences(int value)
          Specifies viewer application preferences for this document.
 void setWriter(PdfWriter w)
          Deprecated. No replacement
 void split(int pages)
          Extract specified number of consecutive pages from the PDF document and place them in new PDF documents.
 void split(String pageRange)
          Extracts all pages in the specified page range to a new document.
 void stitch(int stitchToPageNo, int stitchFromPageNo, double offsetX, double offsetY)
          Overlays all content from a specified page to another page with specified ofsets.
 void stitch(int stitchToPageNo, int stitchFromPageNo, double offsetX, double offsetY, PdfRect clipRegionInSourcePage)
           
 void substituteFont(String replaceFontWithBaseName, PdfFont substituteWithFont)
          Replaces a font in the document with another font.
 long write()
          Deprecated. Use one of the save() overloaded methods instead.
 void writeText(String str)
          Writes specified text at current position on this PdfDocument's current page.
 void writeText(String str, boolean wrap)
          Writes specified text with specified wrap setting at current position on this PdfDocument's current page.
 void writeText(String str, boolean wrap, String pageRange)
          Writes specified text with specified wrap setting at current position on pages in specified page range.
 void writeText(String str, double x, double y)
          Writes specified text at position (x, y) on this PdfDocument's current page.
 void writeText(String str, double x, double y, boolean wrap)
          Writes specified text with specified wrap setting at position (x, y) on this PdfDocument's current page.
 void writeText(String str, double x, double y, boolean wrap, String pageRange)
          Writes specified text with specified wrap setting at position (x, y) on pages in specified page range.
 void writeText(String str, double x, double y, double rotation)
          Writes specified text rotated by rotation degrees at position (x, y) on this PdfDocument's current page.
 void writeText(String str, double x, double y, double rotation, String pageRange)
          Writes specified text rotated by rotation degrees at position (x, y) on pages in specified page range.
 void writeText(String str, double x, double y, int alignment)
          Writes specified text with specified alignment at position (x, y) on this PdfDocument's current page.
 void writeText(String str, double x, double y, int alignment, boolean wrap)
          Writes specified text with specified alignment and wrap setting at position (x, y) on this PdfDocument's current page.
 void writeText(String str, double x, double y, int alignment, boolean wrap, String pageRange)
          Writes specified text with specified alignment and wrap setting at position (x, y) on pages in specified page range.
 void writeText(String str, double x, double y, int alignment, String pageRange)
          Writes specified text with specified alignment at position (x, y) on pages in specified range.
 void writeText(String str, double x, double y, String pageRange)
          Writes specified text at position (x, y) on pages in specified page range.
 void writeText(String str, int alignment)
          Writes specified text with specified alignment at current position on this PdfDocument's current page.
 void writeText(String str, int alignment, boolean wrap)
          Writes specified text with specified alignment and specified wrap setting at current position on this PdfDocument's current page.
 void writeText(String str, int alignment, boolean wrap, String pageRange)
          Writes specified text with specified alignment and wrap setting at current position on pages in specified page range.
 void writeText(String str, int alignment, String pageRange)
          Writes specified text with specified alignment at current position on pages in specified page range.
 void writeText(String str, PdfFont f)
          Writes specified text with specified font on this PdfDocument's current page.
 void writeText(String str, PdfFont f, boolean wrap)
          Writes specified text with specified wrap setting and font on this PdfDocument's current page.
 void writeText(String str, PdfFont f, boolean wrap, String pageRange)
          Writes specified text with specified font and wrap setting on pages in specified page range.
 void writeText(String str, PdfFont f, double x, double y)
          Writes specified text with specified font at position (x, y) on this PdfDocument's current page.
 void writeText(String str, PdfFont f, double x, double y, boolean wrap)
          Writes specified text with specified font and wrap setting at position (x, y) on this PdfDocument's current page.
 void writeText(String str, PdfFont f, double x, double y, boolean wrap, String pageRange)
          Writes specified text with specified font and wrap setting at position (x, y) on pages in specified page range.
 void writeText(String str, PdfFont f, double x, double y, double rotation)
          Writes specified text rotated by rotation degrees with specified font at position (x, y) on this PdfDocument's current page.
 void writeText(String str, PdfFont f, double x, double y, double rotation, String pageRange)
          Writes specified text rotated by rotation degrees with specified font at position (x, y) on pages in specified page range.
 void writeText(String str, PdfFont f, double x, double y, String pageRange)
          Writes specified text with specified font at position (x, y) on pages in specified page range.
 void writeText(String str, PdfFont f, int alignment)
          Writes specified text with specified font and alignment on this PdfDocument's current page.
 void writeText(String str, PdfFont f, int alignment, boolean wrap)
          Writes specified text with specified font, alignment, and wrap setting on this PdfDocument's current page.
 void writeText(String str, PdfFont f, int alignment, boolean wrap, String pageRange)
          Writes specified text with specified font, alignment and wrap setting on pages in specified page range.
 void writeText(String str, PdfFont f, int alignment, double x, double y)
          Writes specified text with specified font and alignment at position (x, y) on this PdfDocument's current page.
 void writeText(String str, PdfFont f, int alignment, double x, double y, boolean wrap)
          Writes specified text with specified font, alignment, and wrapping at position (x, y) on this PdfDocument's current page.
 void writeText(String str, PdfFont f, int alignment, double x, double y, boolean wrap, String pageRange)
          Writes specified text with specified font, alignment, and wrapping at position (x, y) on pages in specified page range.
 void writeText(String str, PdfFont f, int alignment, double x, double y, String pageRange)
          Writes specified text with specified font and alignment at position (x, y) on pages in specified page range.
 void writeText(String str, PdfFont f, int alignment, PdfPoint pt)
          Writes specified text with specified font and alignment at specified point on this PdfDocument's current page.
 void writeText(String str, PdfFont f, int alignment, PdfPoint pt, boolean wrap)
          Writes specified text with specified font, alignment, and wrap setting at specified point on this PdfDocument's current page.
 void writeText(String str, PdfFont f, int alignment, PdfPoint pt, boolean wrap, String pageRange)
          Writes specified text with specified font, alignment, and wrap setting at specified point on pages in specified page range.
 void writeText(String str, PdfFont f, int alignment, PdfPoint pt, String pageRange)
          Writes specified text with specified font and alignment at specified point on pages in specified page range.
 void writeText(String str, PdfFont f, int alignment, String pageRange)
          Writes specified text with specified font and alignment on pages in specified page range.
 void writeText(String str, PdfFont f, PdfPoint pt)
          Writes specified text with specified font at specified point on this PdfDocument's current page.
 void writeText(String str, PdfFont f, PdfPoint pt, boolean wrap)
          Writes text str with specified font and wrap setting at specified point on this PdfDocument's current page.
 void writeText(String str, PdfFont f, PdfPoint pt, boolean wrap, String pageRange)
          Writes text str with specified font and wrap setting at specified point on pages in specified page range.
 void writeText(String str, PdfFont f, PdfPoint pt, double rotation)
          Writes text str rotated by rotation degrees with specified font at specified point on this PdfDocument's current page.
 void writeText(String str, PdfFont f, PdfPoint pt, double rotation, String pageRange)
          Writes text str rotated by rotation degrees with specified font at specified point on pages in specified page range.
 void writeText(String str, PdfFont f, PdfPoint pt, String pageRange)
          Writes specified text with specified font at specified point on pages in specified page range.
 void writeText(String str, PdfFont f, PdfRect rectangle)
          Writes specified text with specified font inside specified rectangle on this PdfDocument's current page.
 void writeText(String str, PdfFont f, PdfRect rectangle, double rotation, double firstLinePosition)
          Writes specified text rotated by rotation degrees with specified font and first-line position inside specified rectangle on this PdfDocument's current page.
 void writeText(String str, PdfFont f, PdfRect rectangle, double rotation, double firstLinePosition, String pageRange)
          Writes specified text rotated by rotation degrees with specified font and first-line position inside specified rectangle on pages in specified page range.
 void writeText(String str, PdfFont f, PdfRect rectangle, int alignment)
          Writes specified text with specified alignment and font inside specified rectangle on this PdfDocument's current page.
 void writeText(String str, PdfFont f, PdfRect rectangle, int alignment, double rotation, double firstLinePosition)
          Writes specified text rotated by rotation degrees with specified alignment, first-line position, and font inside specified rectangle on this PdfDocument's current page.
 void writeText(String str, PdfFont f, PdfRect rectangle, int alignment, double rotation, double firstLinePosition, String pageRange)
          Writes specified text rotated by rotation degrees with specified alignment, first-line position, and font inside specified rectangle on pages in specified page range.
 void writeText(String str, PdfFont f, PdfRect rectangle, int alignment, String pageRange)
          Writes specified text with specified font and alignment inside specified rectangle on pages in specified page range.
 void writeText(String str, PdfFont f, PdfRect rectangle, String pageRange)
          Writes specified text with specified font inside specified rectangle on pages in specified page range.
 void writeText(String str, PdfFont f, String pageRange)
          Writes specified text with specified font on pages in specified page range.
 void writeText(String str, PdfPoint pt)
          Writes specified text at specified point on this PdfDocument's current page.
 void writeText(String str, PdfPoint pt, boolean wrap)
          Writes text str with specified wrap setting at point pt on this PdfDocument's current page.
 void writeText(String str, PdfPoint pt, boolean wrap, String pageRange)
          Writes text str with specified wrap setting at point pt on pages in specified page range.
 void writeText(String str, PdfPoint pt, double rotation)
          Writes text str, rotated by rotation degrees, at point pt on this PdfDocument's current page.
 void writeText(String str, PdfPoint pt, double rotation, String pageRange)
          Writes text str, rotated rotation degrees, at point pt on pages in specified page range.
 void writeText(String str, PdfPoint pt, int alignment, boolean wrap)
          Writes text str with specified alignment and wrap setting at point pt on this PdfDocument's current page.
 void writeText(String str, PdfPoint pt, int alignment, boolean wrap, String pageRange)
          Writes text str with specified alignment and wrap setting at point pt on pages in specified page range.
 void writeText(String str, PdfPoint pt, String pageRange)
          Writes specified text at specified point on pages in specified page range.
 void writeText(String str, PdfRect rectangle)
          Writes specified text inside specified rectangle on this PdfDocument's current page.
 void writeText(String str, PdfRect rectangle, double rotation, double firstLinePosition)
          Writes specified text rotated by rotation degrees with specified first-line position inside specified rectangle on this PdfDocument's current page.
 void writeText(String str, PdfRect rectangle, double rotation, double firstLinePosition, String pageRange)
          Writes specified text rotated by rotation degrees with specified first-line position inside specified rectangle on pages in specified page range.
 void writeText(String str, PdfRect rectangle, int alignment)
          Writes specified text with specfied text alignment on this PdfDocument's current page.
 void writeText(String str, PdfRect rectangle, int alignment, double rotation, double firstLinePosition)
          Writes specified text rotated by rotation degrees with specified first-line position inside specified rectangle on this PdfDocument's current page.
 void writeText(String str, PdfRect rectangle, int alignment, double rotation, double firstLinePosition, String pageRange)
          Writes specified text rotated by rotation degrees with specified alignment and first-line position inside specified rectangle on pages in specified page range.
 void writeText(String str, PdfRect rectangle, int alignment, String pageRange)
          Writes specified text with specified alignment inside specified rectangle on pages in specified page range.
 void writeText(String str, PdfRect rectangle, String pageRange)
          Writes specified text inside specified rectangle on pages in specified page range.
 void writeText(String str, Point pt, int alignment)
          Writes specified text at position pt on current page with specified text alignment.
 void writeText(String str, Point pt, int alignment, String pageRange)
          Writes specified text at position pt with specified text alignment on all pages of a specified page range.
 void writeText(String str, String pageRange)
          Writes specified text at current position on pages in specified page range.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALIGNMENT_LEFT

public static final int ALIGNMENT_LEFT
Constant for aligning form field text to the left.

See Also:
Constant Field Values

ALIGNMENT_CENTER

public static final int ALIGNMENT_CENTER
Constant for aligning form field text to the center.

See Also:
Constant Field Values

ALIGNMENT_RIGHT

public static final int ALIGNMENT_RIGHT
Constant for aligning form field text to right.

See Also:
Constant Field Values

TIFF_Compression_NONE

public static final int TIFF_Compression_NONE
Constant for using no compression when saving to a TIFF image.

See Also:
Constant Field Values

TIFF_Compression_CCITT_RLE

public static final int TIFF_Compression_CCITT_RLE
Constant for using modified Huffman compression (1 bit per component) when saving to a TIFF image.

See Also:
Constant Field Values

TIFF_Compression_CCITT_T4

public static final int TIFF_Compression_CCITT_T4
Constant for using CCITT T.4 bilevel encoding or Group 3 facsimile compression (1 bit per component) when saving to a TIFF image.

See Also:
Constant Field Values

TIFF_Compression_CCITT_T6

public static final int TIFF_Compression_CCITT_T6
Constant for using CCITT T.6 bilevel encoding or Group 4 facsimile compression (1 bit per component) when saving to a TIFF image.

See Also:
Constant Field Values

TIFF_Compression_LZW

public static final int TIFF_Compression_LZW
Constant for using LZW compression (8 bits per component) when saving to a TIFF image.

See Also:
Constant Field Values

TIFF_Compression_JPEG

public static final int TIFF_Compression_JPEG
Constant for using "'New' JPEG-in-TIFF" lossy compression (8 bits per component) when saving to a TIFF image.

See Also:
Constant Field Values

TIFF_Compression_ZLib

public static final int TIFF_Compression_ZLib
Constant for using "Deflate/Inflate compression" (8 bits per component) when saving to a TIFF image.

See Also:
Constant Field Values

TIFF_Compression_PackBits

public static final int TIFF_Compression_PackBits
Constant for using "byte-oriented, run length compression" (8 bits per component) when saving to a TIFF image.

See Also:
Constant Field Values

TIFF_Compression_Deflate

public static final int TIFF_Compression_Deflate
Constant for using "Zip-in-TIFF" compression (8 bits per component) when saving to a TIFF image.

See Also:
Constant Field Values

TIFF_Compression_EXIF_JPEG

public static final int TIFF_Compression_EXIF_JPEG
Constant for using EXIF-specific JPEG compression (8 bits per component) when saving to a TIFF image.

See Also:
Constant Field Values

VERSION_1_4

public static final String VERSION_1_4
PDF version 1.4

See Also:
Constant Field Values

VERSION_1_5

public static final String VERSION_1_5
PDF version 1.5

See Also:
Constant Field Values

VERSION_1_6

public static final String VERSION_1_6
PDF version 1.6

See Also:
Constant Field Values

MERGE_INCLUDE_ANNOTATIONS

public static final int MERGE_INCLUDE_ANNOTATIONS
Flag for inclusion of annotations when merging documents.

See Also:
PdfStdDocument.merge(String), Constant Field Values

MERGE_INCLUDE_BOOKMARKS

public static final int MERGE_INCLUDE_BOOKMARKS
Flag for inclusion of bookmarks when merging documents.

See Also:
PdfStdDocument.merge(String), Constant Field Values

MERGE_INCLUDE_DOCUMENT_ACTIONS

public static final int MERGE_INCLUDE_DOCUMENT_ACTIONS
Flag for inclusion of document-level actions when merging documents.

See Also:
PdfStdDocument.merge(String), Constant Field Values

MERGE_INCLUDE_PAGE_ACTIONS

public static final int MERGE_INCLUDE_PAGE_ACTIONS
Flag for inclusion of page-level actions when merging documents.

See Also:
PdfStdDocument.merge(String), Constant Field Values

MERGE_INCLUDE_FORMFIELDS

public static final int MERGE_INCLUDE_FORMFIELDS
Flag for inclusion of form fields when merging documents.

See Also:
PdfStdDocument.merge(String), Constant Field Values

MERGE_INCLUDE_ALL

public static final int MERGE_INCLUDE_ALL
Flag for inclusion of annotations, bookmarks, document-level actions, page-level actions, and form fields when merging documents.

See Also:
PdfStdDocument.merge(String), Constant Field Values
Constructor Detail

PdfDocument

public PdfDocument()

PdfDocument

public PdfDocument(PdfWriter w)
            throws PdfException
Deprecated. Constructs a new PdfDocument object with a PdfWriter object. The new PdfDocument object is used to create a new PDF file - creation mode.

Parameters:
w - PdfWriter with which the PdfProDocument object needs to be created
Throws:
PdfException - if an illegal argument is supplied.
Sample Code
See example.

PdfDocument

public PdfDocument(PdfReader r)
            throws IOException,
                   PdfException
Deprecated. Constructs a new PdfDocument with a PdfReader object. The new PdfDocument object is used to read/modify an existing file - reading mode.

Parameters:
r - PdfReader with which the PdfProDocument object needs to be created
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Sample Code
See example.
Method Detail

setAutoPaginate

public void setAutoPaginate(boolean autoPaginate)
Description copied from class: com.gnostice.pdfone.PdfStdDocument
Specifies whether content-rendering operations need to paginate automatically.

Parameters:
autoPaginate - true if document auto-paginates; false if otherwise

isAutoPaginate

public boolean isAutoPaginate()
Description copied from class: com.gnostice.pdfone.PdfStdDocument
Returns whether content-rendering operations are set to paginate automatically.

Returns:
true if document paginates automatically; false if otherwise
See Also:
PdfStdDocument.setAutoPaginate(boolean)

isOverrideFieldAppearanceStreams

public boolean isOverrideFieldAppearanceStreams()
Returns whether text associated with all form fields in the document are by default displayed by viewer applications.

Returns:
whether text associated with all form fields in the document are by default displayed
See Also:
setOverrideFieldAppearanceStreams(boolean)

setOverrideFieldAppearanceStreams

public void setOverrideFieldAppearanceStreams(boolean overrideAppearanceStreams)
Specifies whether text associated with all form fields in the document need to be displayed by default. If set to false, then form fields may display the text only when they receive user input focus.

Parameters:
overrideAppearanceStreams - whether text associated with all form fields in the document need to be displayed by default
See Also:
isOverrideFieldAppearanceStreams()

setAuthor

public void setAuthor(String s)
Specifies "author" document property for this document.

Parameters:
s - "author" document property for this document
Since:
1.0
See Also:
getAuthor()
Sample Code
See example.

getAuthor

public String getAuthor()
Returns "author" document property of this document.

Returns:
"author" document property of this document
See Also:
setAuthor(String)

setCreator

public void setCreator(String s)
Set specified "creator" document information property for this document. The creator property is generally used to identify the application that originally created the document.

Parameters:
s - name of the application that needs to be set as the creator of this document
See Also:
getCreator()

getCreator

public String getCreator()
Returns "creator" document information property of the document.

Returns:
"creator" document information property of the document
See Also:
setCreator(String)

setKeywords

public void setKeywords(String s)
Specifies "keywords" document property for this document.

Parameters:
s - "keywords" document property for this document
Since:
1.0
Sample Code
See example.

getKeywords

public String getKeywords()
Returns "keywords" document property of the document.

Returns:
"keywords" document property of the document
See Also:
setKeywords(String)

setSubject

public void setSubject(String s)
Specifies "subject" document property for this document.

Parameters:
s - "subject" document property for this document
Since:
1.0
Sample Code
See example.

getSubject

public String getSubject()
Returns "subject" document property of the document.

Returns:
"subject" document property of the document
See Also:
setSubject(String)

setTitle

public void setTitle(String s)
Specifies "title" document property for this document.

Parameters:
s - "title" document property for this document
Since:
1.0
Sample Code
See example.

getTitle

public String getTitle()
Returns "title" document property of the document.

Returns:
"title" document property of the document
See Also:
setTitle(String)

setOpenAfterSave

public void setOpenAfterSave(boolean openAfterSave)
Specifies whether document needs to be launched by the Operating System (OS) shell program (such as explorer.exe in Windows) after it is saved to a file. This method is currently supported only in Windows OSs.

Parameters:
openAfterSave - whether document needs to be executed after data is saved to file
Since:
1.0
See Also:
isOpenAfterSave(), setPrintAfterSave(boolean)
Sample Code
See example.

isOpenAfterSave

public boolean isOpenAfterSave()
Returns whether document is set to be executed after data is saved to file.

Returns:
whether document is set to be executed after data is saved to file
Since:
1.0
See Also:
setOpenAfterSave(boolean)
Sample Code
See example.

setPrintAfterSave

public void setPrintAfterSave(boolean printAfterSave)
Specifies whether the document needs to be sent to a printer for printing after it is saved to a file. This method is currently supported only in Windows Operating Systems.

Parameters:
printAfterSave - whether the document needs to be printed after it is saved to a file
See Also:
setOpenAfterSave(boolean)

isPrintAfterSave

public boolean isPrintAfterSave()

setBrushColor

public void setBrushColor(Color c)
Specifies default color for this PdfDocument's brush.

Parameters:
c - default color for the PdfDocument's brush
Since:
1.0
See Also:
PdfStdDocument.getBrushColor(), PdfStdDocument.setPenColor(Color)
Sample Code
See example.

getBrushColor

public Color getBrushColor()
Description copied from class: com.gnostice.pdfone.PdfStdDocument
Returns default fill color for content-rendering operations on the document.

Returns:
default fill color
See Also:
PdfStdDocument.setBrushColor(Color), PdfStdDocument.getPenColor()

setMeasurementUnit

public void setMeasurementUnit(int measurementUnit)
Specifies default measurement unit to be used for this PdfDocument.

Parameters:
measurementUnit - constant specifying the new default measurement unit
Since:
1.0
See Also:
getMeasurementUnit(), PdfMeasurement
Sample Code
See example.

getMeasurementUnit

public int getMeasurementUnit()
Returns default measurement unit currently in use for this PdfDocument.

Returns:
constant identifying the current default measurement unit
Since:
1.0
See Also:
setMeasurementUnit(int), PdfMeasurement
Sample Code
See example.

setPageLayout

public void setPageLayout(int value)
Specifies default page layout to be used when opening this document.

Parameters:
value - constant specifying the page layout
Since:
1.0
See Also:
getPageLayout(), PdfPageLayout
Sample Code
See example.

getPageLayout

public int getPageLayout()
Returns constant identifying page layout used as default when opening this document.

Returns:
constant identifying the page layout
Since:
1.0
See Also:
setPageLayout(int), PdfPageLayout
Sample Code
See example.

setPageMode

public void setPageMode(int value)
Specifies default page mode with which this PdfDocument needs to be opened.

Parameters:
value - constant specifying page mode
Since:
1.0
See Also:
getPageMode(), PdfPageMode
Sample Code
See example.

getPageMode

public int getPageMode()
Returns constant identifying this PdfDocument's default page mode. This page mode is applied by default when the document is opened in a viewer application.

Returns:
constant identifying page mode
Since:
1.0
See Also:
setPageMode(int), PdfPageMode
Sample Code
See example.

setPenColor

public void setPenColor(Color color)
Specifies default color for this PdfDocument's pen.

Parameters:
color - default color for the PdfDocument's pen
Since:
1.0
See Also:
PdfStdDocument.getPenColor(), PdfStdDocument.setBrushColor(Color)
Sample Code
See example.

getPenColor

public Color getPenColor()
Description copied from class: com.gnostice.pdfone.PdfStdDocument
Returns default stroking color for content-rendering operations on the pages of the document.

Returns:
default stroking color
See Also:
PdfStdDocument.getBrushColor(), PdfStdDocument.setPenColor(Color)

setVersion

public void setVersion(String version)
Specifies PDF version of this PdfDocument.

Parameters:
version - constant specifying PDF version
Since:
1.0
Sample Code
See example.

getVersion

public String getVersion()
Returns constant identifying this PdfDocument's PDF version.

Returns:
constant identifying PDF version
Since:
1.0
Sample Code
See example.

getViewerPreferences

public int getViewerPreferences()
Returns viewer application preferences of this document.

Returns:
constants specifying viewer application preferences
See Also:
PdfPreferences, PdfProDocument.setViewerPreferences(int)

setViewerPreferences

public void setViewerPreferences(int value)
Specifies viewer application preferences for this document.

Parameters:
value - constants specifying viewer application preferences
See Also:
PdfPreferences, PdfProDocument.getViewerPreferences()

addTable

public void addTable(PdfTable table,
                     double x,
                     double y,
                     int pageNo)
              throws PdfException,
                     IOException
Renders a specified table at a specfied location on specified page.

Parameters:
table - table that needs to be rendered
x - x-coordinate of the location on the page where top-left corner of the table needs to be
y - y-coordinate of the location on the page where top-left corner of the table needs to be
pageNo - page where the table needs to be rendered
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.

addTable

public void addTable(PdfTable table,
                     double x,
                     double y,
                     int pageNo,
                     PdfFont f)
              throws PdfException,
                     IOException
Renders a specified table at a specfied location on specified page with specified font.

Parameters:
table - table that needs to be rendered
x - x-coordinate of the location on the page where top-left corner of the table needs to be
y - y-coordinate of the location on the page where top-left corner of the table needs to be
pageNo - page where the table needs to be rendered
f - font with which the table needs to be rendered
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.

stitch

public void stitch(int stitchToPageNo,
                   int stitchFromPageNo,
                   double offsetX,
                   double offsetY)
            throws PdfException,
                   IOException
Overlays all content from a specified page to another page with specified ofsets.

Parameters:
stitchToPageNo - number of the page on which contents from the page stitchFromPageNo need to be overlaid
stitchFromPageNo - number of the page whose contents should be overlaid on page specified by stitchToPageNo
offsetX - x-coordinate of the position on page stitchToPageNo where the top-left corner of the contents of page stitchFromPageNo should be overlaid
offsetY - y-coordinate of the position on page stitchToPageNo where the top-left corner of the contents of page stitchFromPageNo should be overlaid
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.

stitch

public void stitch(int stitchToPageNo,
                   int stitchFromPageNo,
                   double offsetX,
                   double offsetY,
                   PdfRect clipRegionInSourcePage)
            throws PdfException,
                   IOException
Throws:
PdfException
IOException

attachDocument

public void attachDocument(String fileName)
                    throws IOException,
                           PdfException
Adds specified file as a document-level attachment.

Parameters:
fileName - pathname of the file
Throws:
IOException
PdfException
See Also:
PdfProDocument.getAttachments()

attachDocument

public void attachDocument(String fileName,
                           boolean compressAttachmentStream)
                    throws IOException,
                           PdfException
Adds specified file as a document-level attachment and compresses it if specified.

Parameters:
fileName - pathname of the file
compressAttachmentStream - whether to store the file in compressed form
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.

attachDocument

public void attachDocument(PdfFileAttachment fa)
Adds specified file attachment to the document.

Parameters:
fa - file attachment that needs to be added to the document

attachDocument

public void attachDocument(String attachmentName,
                           byte[] bs)
                    throws IOException,
                           PdfException
Adds file in specified byte array as a document-level attachment.

Parameters:
attachmentName - name of the attachment in the document
bs - byte array containing the file
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.

attachDocument

public void attachDocument(String attachmentName,
                           byte[] bs,
                           boolean compressAttachmentStream)
                    throws IOException,
                           PdfException
Adds file in specified byte array as a document-level attachment and compress it if specified.

Parameters:
attachmentName - name of the attachment in the document
bs - byte array containing the file
compressAttachmentStream - whether to store the file in compressed form
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.

removeAllAttachments

public void removeAllAttachments()
Deletes all attachments in the document.


removeAllAttachments

public void removeAllAttachments(String attachmentName)
                          throws IOException,
                                 PdfException
Deletes all attachments with specified name in the document.

Parameters:
attachmentName - name of the attachments in the document
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.

embedFont

public void embedFont(PdfFont fontToBeEmbedded)
               throws PdfException,
                      IOException
Embeds specified font in the document. Use this method when a font needs to be embedded to an existing document, that is, in reading mode. Also, ensure that the PdfFont object is created using the PdfFont.EMBED_FULL setting.

Parameters:
fontToBeEmbedded - font that needs to be embedded
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.
See Also:
PdfFont.create(String, int, int, byte), PdfFont.create(String, int, int, int, byte)

embedFont

public void embedFont(PdfFont fontToBeEmbedded,
                      String originalFont)
               throws IOException,
                      PdfException
Embeds specified font in place of another font already existing in the document. Use this method when a font needs to be embedded to an existing document, that is, in reading mode. Also, ensure that the font is created using the PdfFont.EMBED_FULL setting. Specify the original font by its base name.

Parameters:
fontToBeEmbedded - font that needs to be embedded in the document
originalFont - base name of the font that needs to be replaced
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.
See Also:
PdfFont.create(String, int, int, byte), PdfFont.create(String, int, int, int, byte), PdfProDocument.getAllFontBaseNames(), PdfProDocument.getAllFontBaseNames(String)

replaceAllEmbeddedFonts

public void replaceAllEmbeddedFonts(PdfFont replaceWithFont)
                             throws PdfException,
                                    IOException
Replaces all embedded fonts with specified font.

Parameters:
replaceWithFont - font with which embedded fonts need to be replaced
Throws:
PdfException - if an I/O error occurs.
IOException - if an illegal argument is supplied.

replaceEmbeddedFont

public void replaceEmbeddedFont(String embeddedFontBaseName,
                                PdfFont replaceWithFont)
                         throws PdfException,
                                IOException
Replace specified embedded font with another specified font.

Parameters:
embeddedFontBaseName - font that needs to be replaced
replaceWithFont - font with which the embedded fonts needs to be replaced.
Throws:
PdfException - if an I/O error occurs.
IOException - if an illegal argument is supplied.

substituteFont

public void substituteFont(String replaceFontWithBaseName,
                           PdfFont substituteWithFont)
                    throws PdfException,
                           IOException
Replaces a font in the document with another font.

Parameters:
replaceFontWithBaseName - base name of the font that needs to be replaced
substituteWithFont - font that will be replace the existing font
Throws:
PdfException - if called in writing mode or if an illegal argument is called
IOException - if an I/O error occurs.

getAllEmbededFontNames

public List getAllEmbededFontNames()
                            throws IOException,
                                   PdfException
Returns a list of names of all embedded fonts in the document.

Returns:
a list of names of all embedded fonts
Throws:
IOException - if I/O exception is raised.
PdfException - if called in creation mode.

getAttachments

public ArrayList getAttachments()
                         throws IOException,
                                PdfException
Returns a list of file attachments in the document.

Returns:
list of ByteBuffer objects representing file attachments
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
See Also:
PdfProDocument.attachDocument(String)

getPdfFileAttachments

public List getPdfFileAttachments()
                           throws PdfException,
                                  IOException
Returns a list of file attachments in the document.

Returns:
a list of file attachments in the document
Throws:
PdfException - if called in creation mode.
IOException - if an I/O error occurs.
See Also:
PdfFileAttachment

addThumbnailImage

public void addThumbnailImage(String path,
                              int pageNo)
                       throws IOException,
                              PdfException
Adds specified image as thumbnail for specified page.

Parameters:
path - pathname of the thumbnail image
pageNo - number of the page in the document
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
See Also:
PdfProDocument.removeThumbnailImage(String)

removeThumbnailImage

public void removeThumbnailImage(String pageRange)
                          throws PdfException
Removes thumbnail image for specified pages.

Parameters:
pageRange - pages for which there ought to be no thumbnails
Throws:
PdfException - if an illegal argument is supplied.
See Also:
PdfProDocument.addThumbnailImage(String, int)

addAnnotation

public void addAnnotation(PdfAnnot annotation,
                          int pageNo)
                   throws PdfException,
                          IOException
Adds specified annotation to specified page.

Parameters:
annotation - new annotation that needs to be added
pageNo - number of the page to which the annotation needs to be added
Throws:
PdfException - if an illegal argument is supplied.
IOException
Sample Code
See example.

addAnnotationList

public void addAnnotationList(List annotList,
                              int pageNo)
                       throws PdfException,
                              IOException
Adds a specified list of annotations to a specified page. Measurement units used by the page will be applied for the annotations.

Parameters:
annotList - list of new annotations that need to be added
pageNo - number of the page to which the annotations need to be added
Throws:
PdfException - if an illegal argument is supplied.
IOException
Sample Code
See example.

addAnnotationList

public void addAnnotationList(List annotList,
                              int pageNo,
                              boolean removeExistingAnnots)
                       throws PdfException,
                              IOException
Adds a specified list of annotations to a specified page, and removes or keeps existing annotations. Measurement units used by the page will be applied for the annotations.

Parameters:
annotList - list of new annotations that need to be added
pageNo - number of the page to which the annotations need to be added
removeExistingAnnots - whether to remove or keep existing annotations in the page
Throws:
PdfException - if an illegal argument is supplied.
IOException
Sample Code
See example.

addAnnotationList

public void addAnnotationList(List annotList,
                              String[] pageRanges,
                              boolean removeExistingAnnots,
                              int measurementUnit)
                       throws PdfException
Adds specified list of annotations to specified pages at locations in specified measurement unit, and also remove or keep existing annotations in the document.

Parameters:
annotList - list of new annotations that need to be added
pageRanges - page range in whose pages the annotations need to be added
removeExistingAnnots - whether to remove or keep existing annotations in the page
measurementUnit - constant specifying the measurement unit that needs to be applied for the annotations
Throws:
PdfException - if an illegal argument is supplied.
See Also:
PdfMeasurement
Sample Code
See example.

addAnnotationList

public void addAnnotationList(List annotList,
                              String[] pageRanges,
                              int measurementUnit)
                       throws PdfException
Adds specified list of annotations to specified pages at locations in specified measurement unit.

Parameters:
annotList - list of new annotations that need to be added
pageRanges - pages where the annotations need to be added
measurementUnit - constant specifying the measurement unit that needs to be applied for the annotations
Throws:
PdfException - if an illegal argument is supplied.
Sample Code
See example.

addDefaultFormFont

public void addDefaultFormFont(PdfFont font)

addDefaultFormFontList

public void addDefaultFormFontList(List fontList)

addFormField

public void addFormField(PdfFormField formField,
                         int pageNo)
                  throws PdfException,
                         IOException
Add specified form field to specified page.

Parameters:
formField - form field that needs to be added
pageNo - number of the page to which the form field needs to be added
Throws:
PdfException - if an illegal argument is supplied.
IOException
Sample Code
See example.

addFormField

public void addFormField(PdfFormField f,
                         String[] pageRanges)
                  throws PdfException
Adds children of specified form field (radio button group or check box group) to a specified page ranges. The nth child form field will be added to the nth page range in the page range array.

Parameters:
f - form field (radio button group or check box group) whose children need to be added
pageRanges - page ranges to which children form fields need to be added
Throws:
PdfException - if an illegal argument is supplied.

addFormFieldList

public void addFormFieldList(List formFieldList,
                             int pageNo)
                      throws PdfException,
                             IOException
Add a list of form field to a specified page.

Parameters:
formFieldList - list of form fields that need to be added to the page
pageNo - number of the page to which the form fields need to be added
Throws:
PdfException - if an illegal argument is supplied.
IOException
Sample Code
See example.

deleteFormFields

public void deleteFormFields()
                      throws IOException,
                             PdfException
Removes all form fields in the document.

Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.

deleteFormFields

public void deleteFormFields(int type)
                      throws IOException,
                             PdfException
Removes all form fields of specified type in the document.

Parameters:
type - constant specifying the form field type
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.

deleteFormFields

public void deleteFormFields(String name)
                      throws IOException,
                             PdfException
Removes all form fields with specified name in the document.

Parameters:
name - name of the form fields
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.

deleteFormFieldsOnPage

public void deleteFormFieldsOnPage(int pageNo)
                            throws IOException,
                                   PdfException
Removes all form fields on specified page.

Parameters:
pageNo - number of the page
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.

deleteFormFieldsOnPage

public void deleteFormFieldsOnPage(int pageNo,
                                   int type)
                            throws IOException,
                                   PdfException
Removes all form fields of specified type on specified page.

Parameters:
pageNo - number of the page
type - form field type
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.

deleteFormFieldsOnPage

public void deleteFormFieldsOnPage(int pageNo,
                                   String name)
                            throws IOException,
                                   PdfException
Removes all form fields with specified name in specified page.

Parameters:
pageNo - number of the page
name - name of the form fields
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.

exportToFDF

public void exportToFDF(File fdfFile)
                 throws IOException,
                        PdfException
Writes interactive forms data of the PDF document to an FDF (Forms Data Format) file.

Parameters:
fdfFile - FDF file to which interactive forms data needs to be written
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
See Also:
PdfProDocument.importFromFDF(File)

flattenFormFields

public void flattenFormFields()
                       throws IOException,
                              PdfException
Flattens all form fields in the document. Flattening a form field removes its interactivity.

Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.

flattenFormFields

public void flattenFormFields(boolean flattenWithNewValue)
                       throws IOException,
                              PdfException
Flattens all form fields with or without retaining new values.

Parameters:
flattenWithNewValue - whether to retain new values. If false, form fields will be flattened with their original values.
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.

flattenFormFields

public void flattenFormFields(int type)
                       throws IOException,
                              PdfException
Flatens form fields of specified type.

Parameters:
type - constant specifying form field type
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
See Also:
PdfFormField

flattenFormFields

public void flattenFormFields(int type,
                              boolean flattenWithNewValue)
                       throws IOException,
                              PdfException
Flattens a form field of specified type with or without retaining new values.

Parameters:
type - constant specifying form field type
flattenWithNewValue - whether to retain new values. If false, form fields will be flattened with their original values.
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
See Also:
PdfFormField

flattenFormFields

public void flattenFormFields(String name)
                       throws IOException,
                              PdfException
Flattens form fields with specified name.

Parameters:
name - name of the form fields
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.

flattenFormFields

public void flattenFormFields(String name,
                              boolean flattenWithNewValue)
                       throws IOException,
                              PdfException
Flattens form fields having specified name with or without retaining new values.

Parameters:
name - name of the form fields
flattenWithNewValue - whether to retain new values. If false, form fields will be flattened with their original values.
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.

flattenFormFieldsOnPage

public void flattenFormFieldsOnPage(int pageNo)
                             throws IOException,
                                    PdfException
Flattens all form fields on specified page.

Parameters:
pageNo - number of the page
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.

flattenFormFieldsOnPage

public void flattenFormFieldsOnPage(int pageNo,
                                    boolean flattenWithNewValue)
                             throws IOException,
                                    PdfException
Flatten form fields on specified page with or without retaining new values.

Parameters:
pageNo - number of the page
flattenWithNewValue - whether to retain new values. If false, form fields will be flattened with their original values.
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.

flattenFormFieldsOnPage

public void flattenFormFieldsOnPage(int pageNo,
                                    int type)
                             throws IOException,
                                    PdfException
Flatten form fields of specified type in specified page.

Parameters:
pageNo - number of the page
type - constant specifying form field type
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
See Also:
PdfFormField

flattenFormFieldsOnPage

public void flattenFormFieldsOnPage(int pageNo,
                                    int type,
                                    boolean flattenWithNewValue)
                             throws IOException,
                                    PdfException
Flattens form fields of specified type on specified page with or without retaining new values.

Parameters:
pageNo - number of the page
type - constant specifying form field type
flattenWithNewValue - whether to retain new values. If false, form fields will be flattened with their original values.
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
See Also:
PdfFormField

flattenFormFieldsOnPage

public void flattenFormFieldsOnPage(int pageNo,
                                    String name)
                             throws IOException,
                                    PdfException
Flattens form fields with specified name on specified page.

Parameters:
pageNo - number of the page
name - name of the form fields
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.

flattenFormFieldsOnPage

public void flattenFormFieldsOnPage(int pageNo,
                                    String name,
                                    boolean flattenWithNewValue)
                             throws IOException,
                                    PdfException
Flattens all form fields with specified name on specified page with or without applying new values.

Parameters:
pageNo - number of the page
name - name of the form fields
flattenWithNewValue - whether to retain new values. If false, form fields will be flattened with their original values.
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.

getAllAnnotations

public List getAllAnnotations()
                       throws IOException,
                              PdfException
Returns a list of all annotations in the document.

Returns:
a list of all annotations in the document
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.

getAllAnnotations

public List getAllAnnotations(int type)
                       throws IOException,
                              PdfException
Get all annotations of specified type.

Parameters:
type - constant specifying annotation type
Returns:
list of all annotations of specified type
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
See Also:
PdfAnnot

getAllAnnotations

public void getAllAnnotations(int type,
                              List listToPopulate)
                       throws IOException,
                              PdfException
Populates a specified list with all annotations of specified type in the document.

Parameters:
type - constant specifying the type of annotations
listToPopulate - list that needs to be populated
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.

getAllAnnotations

public void getAllAnnotations(List listToPopulate)
                       throws IOException,
                              PdfException
Populates a specified list with all annotations in the document.

Parameters:
listToPopulate - list that needs to be populated
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.

getAllAnnotationsOnPage

public List getAllAnnotationsOnPage(int pageNo)
                             throws PdfException,
                                    IOException
Returns a list of all annotations in specified page.

Parameters:
pageNo - number of the page
Returns:
a list of all annotations in specified page
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.

getAllAnnotationsOnPage

public List getAllAnnotationsOnPage(int pageNo,
                                    int type)
                             throws PdfException,
                                    IOException
Returns a list of annotations of specified type in specified page.

Parameters:
pageNo - number of the page
type - constant specifying annotation type
Returns:
a list of annotations
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.
See Also:
PdfAnnot

getAllAnnotationsOnPage

public void getAllAnnotationsOnPage(int pageNo,
                                    int type,
                                    List listToPopulate)
                             throws PdfException,
                                    IOException
Populates a specified list with all annotations of specified type in a specified page.

Parameters:
pageNo - number of the page
type - constant specifying annotation type
listToPopulate - list that needs to be populated
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.
See Also:
PdfAnnot

getAllAnnotationsOnPage

public void getAllAnnotationsOnPage(int pageNo,
                                    List listToPopulate)
                             throws IOException,
                                    PdfException
Populates a specified list with all annotations in a specified page.

Parameters:
pageNo - number of the page
listToPopulate - list that needs to be populated
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.

getAllFormFields

public List getAllFormFields()
                      throws IOException,
                             PdfException
Returns a list of all form fields in the document.

Returns:
a list of all form fields in the document
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.

getAllFormFields

public List getAllFormFields(int type)
                      throws IOException,
                             PdfException
Returns a list of all form fields of specified type.

Parameters:
type - constant specifying form field type
Returns:
a list of all form fields of specified type
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
See Also:
PdfFormField

getAllFormFields

public List getAllFormFields(String name)
                      throws IOException,
                             PdfException
Returns a list of all form fields with specified name.

Parameters:
name - name specified for the form fields in the document
Returns:
a list containing the form fields
Throws:
IOException - if an illegal argument is supplied.
PdfException - if an I/O error occurs.

getAllFormFieldsOnPage

public List getAllFormFieldsOnPage(int pageNo)
                            throws IOException,
                                   PdfException
Returns a list of all form fields on specified page.

Parameters:
pageNo - number of the page
Returns:
a list of all form fields on specified page
Throws:
IOException - if an illegal argument is supplied.
PdfException - if an I/O error occurs.

getAllFormFieldsOnPage

public List getAllFormFieldsOnPage(int pageNo,
                                   int type)
                            throws IOException,
                                   PdfException
Returns a list of all form fields in specified page.

Parameters:
pageNo - number of the page
type - constant specifying form field type
Returns:
a list of all form fields on specified page
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
See Also:
PdfFormField

getAllFormFieldsOnPage

public List getAllFormFieldsOnPage(int pageNo,
                                   String name)
                            throws IOException,
                                   PdfException
Populates a list of all form fields with specified name in specified page.

Parameters:
pageNo - number of the page
name - name of the form field
Returns:
a list of all form fields with specified name in specified page
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.

getAllFontBaseNames

public List getAllFontBaseNames()
                         throws PdfException,
                                IOException
Returns a list of base names of all fonts used in the document. This method may be useful when embedding a font in place of another font already existing in the document.

Returns:
list of base names of all fonts used in the document
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.
See Also:
PdfProDocument.embedFont(PdfFont, String)

getAllFontBaseNames

public List getAllFontBaseNames(String pageRange)
                         throws PdfException,
                                IOException
Returns a list of basenames of all fonts used in pages in the specified page range. This method may be useful when embedding a font in place of another font already existing in the document.

Parameters:
pageRange - page range from which fonts are identified
Returns:
a list of basenames of all fonts used in pages in the specified page range
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.
See Also:
PdfProDocument.embedFont(PdfFont, String)

getDefaultFieldAlignment

public int getDefaultFieldAlignment()
Returns default text alignment for form fields in the document.

Returns:
constant specifying the default text alignment
See Also:
PdfProDocument.setDefaultFieldAlignment(int)

getDefaultFormFontColor

public Color getDefaultFormFontColor()
Returns default color for form field text in the document.

Returns:
default color for form field text in the document
See Also:
PdfProDocument.setDefaultFormFontColor(Color)

getDefaultFormFontList

public List getDefaultFormFontList()

importFromFDF

public void importFromFDF(File fileName)
                   throws IOException,
                          PdfException
Save interactive forms data imported from a specified FDF (Forms Data Format) file.

Parameters:
fileName - FDF file from which interactive forms data needs to be imported
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.

isAutoAdjustFieldTextHeight

public boolean isAutoAdjustFieldTextHeight()
Returns whether the size of text inside text box, list box and combo box form fields will be adjusted by the viewer application so that the text is fully accommodated inside the fields without any cropping.

See Also:
PdfProDocument.setAutoAdjustFieldTextHeight(boolean)

setAutoAdjustFieldTextHeight

public void setAutoAdjustFieldTextHeight(boolean autoAdjustFieldTextHeight)
Specifies whether the size of text inside text box, list box and combo box form fields needs to be adjusted by the viewer application so that the text is fully accommodated inside the fields without any cropping.

Parameters:
autoAdjustFieldTextHeight - whether the size of text inside text box, list box and combo box form fields needs to be adjusted
See Also:
PdfProDocument.isAutoAdjustFieldTextHeight(), PdfFormTextField.setAutoAdjustTextHeight(boolean), PdfFormListBox, PdfFormComboBox

setDefaultFieldAlignment

public void setDefaultFieldAlignment(int defualtFieldAlignment)
Specifies default text alignment for form fields in the document.

Parameters:
defualtFieldAlignment - constant specifying default text alignment for form fields
See Also:
PdfProDocument.getDefaultFieldAlignment()

setDefaultFormFontColor

public void setDefaultFormFontColor(Color defaultFormFontColor)
Specifies default color for form field text in the document.

Parameters:
defaultFormFontColor - default color for form field text in the document
See Also:
PdfProDocument.getDefaultFormFontColor()

setDefaultFormFontIndex

public void setDefaultFormFontIndex(int defaultFormFontIndex)

setDefaultFormFontList

public void setDefaultFormFontList(List fontList)

deleteAnnotations

public void deleteAnnotations()
                       throws IOException,
                              PdfException
Delete all annotations in this document.

Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.

deleteAnnotations

public void deleteAnnotations(int type)
                       throws IOException,
                              PdfException
Delete all annotations of specified type in the document.

Parameters:
type - constant specifying annotation type
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.

deleteAnnotationsOnPage

public void deleteAnnotationsOnPage(int pageNo)
                             throws IOException,
                                    PdfException
Delete all annotations on specified page.

Parameters:
pageNo - number of the page
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.

deleteAnnotationsOnPage

public void deleteAnnotationsOnPage(int pageNo,
                                    int type)
                             throws IOException,
                                    PdfException
Deletes all annotations of specified in specified page.

Parameters:
pageNo - number of the page
type - constant specifying annotation type
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.

renderOnGraphics

public void renderOnGraphics(int pageNum,
                             Graphics g)
                      throws IOException,
                             PdfException
Renders contents of specified page on specified graphics object.

Parameters:
pageNum - number of the page
g - graphics item on which the page contents needs to be rendered
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.

renderOnGraphics

public void renderOnGraphics(int pageNum,
                             Graphics g,
                             Rectangle2D rect)
                      throws IOException,
                             PdfException
Renders contents of specified page on a specified rectangular area on a specified graphics item.

Parameters:
pageNum - number of the page
g - graphics item on which the page contents needs to be rendered
rect - rectangular area on the graphics item where the page needs to be rendered
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.

renderOnGraphics

public void renderOnGraphics(int pageNum,
                             Graphics g,
                             double x,
                             double y,
                             double width,
                             double height)
                      throws IOException,
                             PdfException
Renders contents of specified page on a rectangular area (specified by coordinates of its top left corner, its height and its width) inside a specified graphics item.

Parameters:
pageNum - number of the page
g - graphics item on which the page contents needs to be rendered
x - x-coordinate of the top-left coordinate of the rectangular area
y - y-coordinate of the top-left coordinate of the rectangular area
width - width of the rectangular area
height - height of the rectangular area
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.

renderOnGraphics

public void renderOnGraphics(int pageNum,
                             Graphics g,
                             Point2D position,
                             double zoom)
                      throws IOException,
                             PdfException
Renders contents of specified page at a particular position on a specified graphics item with specified magnification of the page contents. This method preserves aspect ratio of the rendered image.

Parameters:
pageNum - number of the page
g - graphics item on which the page contents needs to be rendered
position - position where the graphics item needs to be rendered
zoom - factor by which the graphics item needs to be magnified
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.

renderOnGraphics

public void renderOnGraphics(int pageNum,
                             Graphics g,
                             Point2D position,
                             double xZoom,
                             double yZoom)
                      throws IOException,
                             PdfException
Renders contents of specified page at specified position on specified graphics item with specified magnification of height and width of the page contents. This method does not preserve aspect ratio of the rendered image.

Parameters:
pageNum - number of the page
g - graphics item on which the page contents needs to be rendered
position - position where the graphics item needs to be rendered
xZoom - factor by which the width of the page contents needs to be magnified
yZoom - factor by which the height of the page contents needs to be magnified
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.

renderOnGraphics

public void renderOnGraphics(int pageNum,
                             Graphics g,
                             Point2D position,
                             double xZoom,
                             double yZoom,
                             double rotation,
                             double pointOfRotationAboutWidth,
                             double pointOfRotationAboutHeight)
                      throws IOException,
                             PdfException
Renders contents of specified page at specified position on specified graphics item with specified resolution, and magnification of width and height of the page contents. This method does not preserve aspect ratio.

Parameters:
pageNum - number of the page
g - graphics item on which the page contents needs to be rendered
position - position where the graphics item needs to be rendered
xZoom - factor by which the width of the page contents needs to be magnified
yZoom - factor by which the height of the page contents needs to be magnified
rotation - angle of rotation with which the contents need to be rendered
pointOfRotationAboutWidth -
pointOfRotationAboutHeight -
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.

renderOnGraphics

public void renderOnGraphics(int pageNum,
                             Graphics g,
                             Point2D position,
                             double xZoom,
                             double yZoom,
                             int scaleToResolution)
                      throws IOException,
                             PdfException
Renders contents of specified page at specified position on specified graphics item with specified resolution, and magnification of width and height of the page contents. This method does not preserve aspect ratio.

Parameters:
pageNum - number of the page
g - graphics item on which the page contents needs to be rendered
position - position where the graphics item needs to be rendered
xZoom - factor by which the width of the page contents needs to be magnified
yZoom - factor by which the height of the page contents needs to be magnified
scaleToResolution - resolution of the rendered image
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.

getPageAsBufferedImage

public BufferedImage getPageAsBufferedImage(int pageNum)
                                     throws IOException,
                                            PdfException
Returns a buffered image of the contents of specfied page. A buffered-image version of a page can be used in many ways, such as saving to a format of choice using a method such as javax.imageio.ImageIO.write().
   // Read from an existing PDF document 
   PdfReader r = PdfReader.fileReader("input_doc.pdf");
   PdfDocument d = new PdfDocument(r);

   // Create a bufferred image object
   BufferedImage pageAsImage = null;

   try {
     // Obtain a buffered-image version of page 1 contents
     pageAsImage = d.getPageAsBufferedImage(1);

     // Save buffered image to PNG format
     ImageIO.write(pageAsImage, "png", new File("page1.png"));
   }
   catch (IOException ioe)
   {
     System.out.println(ioe.getMessage());
   }

   r.dispose();

Parameters:
pageNum - number of the page
Returns:
a buffered image of contents of the page
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.

getPageAsBufferedImage

public BufferedImage getPageAsBufferedImage(int pageNum,
                                            int width,
                                            int height)
                                     throws IOException,
                                            PdfException
Returns a buffered image (with specified width and height) of the contents of specfied page.

Parameters:
pageNum - number of the page
width - width of the image
height - height of the image
Returns:
a buffered image of the contents of the page
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.

getPageAsBufferedImage

public BufferedImage getPageAsBufferedImage(int pageNum,
                                            int width,
                                            int height,
                                            int scaleToResolution)
                                     throws IOException,
                                            PdfException
Returns a buffered image (with specified width and height) of the contents of specfied page scaled to a specified resolution.

Parameters:
pageNum - number of the page
width - width of the image
height - height of the image
scaleToResolution - DPI to which the page needs to be scaled before it is exported as an image
Returns:
a buffered image of the contents of the page
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.

getPageAsBufferedImage

public BufferedImage getPageAsBufferedImage(int pageNum,
                                            int width,
                                            int height,
                                            int scaleToResolution,
                                            double zoom)
                                     throws IOException,
                                            PdfException
Throws:
IOException
PdfException

getPageAsBufferedImage

public BufferedImage getPageAsBufferedImage(int pageNum,
                                            int scaleToResolution,
                                            double zoomPercentage,
                                            int rotationAngle)
                                     throws IOException,
                                            PdfException
Throws:
IOException
PdfException

getPageAsBufferedImage

public BufferedImage getPageAsBufferedImage(int pageNum,
                                            int width,
                                            int height,
                                            int bufferedImageType,
                                            int scaleToResolution)
                                     throws PdfException,
                                            IOException
Returns a buffered image of specified type (with specified width and height) of the contents of specfied page scaled to a specified resolution.

Parameters:
pageNum - number of the page
width - width of the image
height - height of the image
bufferedImageType - constant specifying type of the buffered image
scaleToResolution - DPI to which the page needs to be scaled before it is exported as an image
Returns:
a buffered image of the contents of the page
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.

getPageAsBufferedImage

public BufferedImage getPageAsBufferedImage(int pageNum,
                                            int width,
                                            int height,
                                            int bufferedImageType,
                                            int scaleToResolution,
                                            double zoom)
                                     throws PdfException,
                                            IOException
Throws:
PdfException
IOException

saveDocAsTiffImage

public void saveDocAsTiffImage(String filePath)
                        throws IOException,
                               PdfException
Exports the document as a multi-page TIFF image with specified pathname.

Parameters:
filePath - pathname of the directory where the image need to be created
Throws:
IOException - if an I/O error occurs.
PdfException - if Java Advanced Imaging API is not available; if called in PDF creation mode; if an illegal argument is supplied.

saveDocAsTiffImage

public void saveDocAsTiffImage(String filePath,
                               int scaleToResolution)
                        throws IOException,
                               PdfException
Exports the document as a multi-page TIFF image with specified pathname and resolution.

Parameters:
filePath - pathname of the directory where the image need to be created
scaleToResolution - resolution to which pages should be scaled before their contents are exported
Throws:
IOException - if an I/O error occurs.
PdfException - if a resolution value from 11 to 4799 is not supplied; if Java Advanced Imaging API is not available; if a resolution value from 11 to 4799 is not supplied; if called in PDF creation mode.

saveDocAsTiffImage

public void saveDocAsTiffImage(String pageRange,
                               String filePath)
                        throws IOException,
                               PdfException
Exports specified pages as a multi-page TIFF image with specified pathname.

Parameters:
pageRange - pages that need to be exported
filePath - pathname of the directory where the image need to be created
Throws:
IOException - if an I/O error occurs.
PdfException - if Java Advanced Imaging API is not available; if called in PDF creation mode; if an invalid page range is supplied; if an invalid argument is supplied.

saveDocAsTiffImage

public void saveDocAsTiffImage(String pageRange,
                               String filePath,
                               int scaleToResolution)
                        throws IOException,
                               PdfException
Exports specified pages as a multi-page TIFF image with specified pathname and resolution.

Parameters:
pageRange - pages that need to be exported
filePath - pathname of the directory where the image need to be created
scaleToResolution -
Throws:
IOException - if an I/O error occurs.
PdfException - if a resolution value from 11 to 4799 is not supplied; if Java Advanced Imaging API is not available; if called in PDF creation mode; if an invalid page range is supplied; if an invalid argument is supplied.

saveDocAsTiffImage

public void saveDocAsTiffImage(String filePath,
                               int tiffCompressionType,
                               float tiffCompressionQuality)
                        throws PdfException,
                               IOException
Exports the document as a multi-page TIFF image with specified pathname, compression type, and compression quality. For lossy compression types, compression quality determines the tradeoff between file size and quality. For lossless compression types, compression quality determines the tradeoff between file size and time taken to accomplish the compression.

Parameters:
filePath - pathname of the directory where the image need to be created
tiffCompressionType - constant specifying the compression type
tiffCompressionQuality - a number from 0.0 to 1.0 where 0.0 signifies that high compression is important while 1.0 signifies high image quality is important
Throws:
PdfException - if Java Advanced Imaging API is not available; if called in PDF creation mode; if an invalid argument is supplied.
IOException - if an I/O error occurs

saveDocAsTiffImage

public void saveDocAsTiffImage(String filePath,
                               int tiffCompressionType,
                               float tiffCompressionQuality,
                               int scaleToResolution)
                        throws PdfException,
                               IOException
Exports the document as a multi-page TIFF image with specified pathname, compression type, compression quality, and resolution. For lossy compression types, compression quality determines the tradeoff between file size and quality. For lossless compression types, compression quality determines the tradeoff between file size and time taken to accomplish the compression.

Parameters:
filePath - pathname of the directory where the image need to be created
tiffCompressionType - constant specifying the compression type
tiffCompressionQuality - a number from 0.0 to 1.0 where 0.0 signifies that high compression is important while 1.0 signifies high image quality is important
scaleToResolution - resolution to which pages should be scaled before their contents are exported
Throws:
PdfException - if an I/O error occurs.
IOException - if a resolution value from 11 to 4799 is not supplied; if Java Advanced Imaging API is not available; if called in PDF creation mode; if an invalid argument is supplied.

saveDocAsTiffImage

public void saveDocAsTiffImage(String filePath,
                               String pageRange,
                               int tiffCompressionType,
                               float tiffCompressionQuality,
                               int scaleToResolution,
                               double zoom)
                        throws PdfException,
                               IOException
Exports specified pages as a multi-page TIFF image with specified pathname, compression type, compression quality, scaling, and magnification. For lossy compression types, compression quality determines the tradeoff between file size and quality. For lossless compression types, compression quality determines the tradeoff between file size and time taken to accomplish the compression.

Parameters:
filePath - pathname of the directory where the image need to be created
pageRange - pages that need to be converted
tiffCompressionType - constant specifying the compression type
tiffCompressionQuality - a number from 0.0 to 1.0 where 0.0 signifies that high compression is important while 1.0 signifies high image quality is important
scaleToResolution - resolution to which pages should be scaled before their contents are exported
zoom - percentage factor by which page contents need to be zoomed
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.

saveDocAsTiffImage

public void saveDocAsTiffImage(String filePath,
                               String pageRange,
                               int tiffCompressionType,
                               float tiffCompressionQuality)
                        throws PdfException,
                               IOException
Exports specified pages as a multi-page TIFF image with specified pathname, compression type, and compression quality. For lossy compression types, compression quality determines the tradeoff between file size and quality. For lossless compression types, compression quality determines the tradeoff between file size and time taken to accomplish the compression.

Parameters:
filePath - pathname of the directory where the image need to be created
pageRange - pages that need to be exported
tiffCompressionType - constant specifying the compression type
tiffCompressionQuality - a number from 0.0 to 1.0 where 0.0 signifies that high compression is important while 1.0 signifies high image quality is important
Throws:
PdfException - if Java Advanced Imaging API is not available; if called in PDF creation mode; if an invalid page range is supplied; if an invalid argument is supplied.
IOException - if an I/O error occurs.

saveDocAsTiffImage

public void saveDocAsTiffImage(String filePath,
                               String pageRange,
                               int width,
                               int height,
                               int tiffCompressionType,
                               float tiffCompressionQuality,
                               int scaleToResolution)
                        throws PdfException,
                               IOException
Exports specified pages as a multi-page TIFF image with specified pathname, widht, height, compression type, compression quality, scaling. For lossy compression types, compression quality determines the tradeoff between file size and quality. For lossless compression types, compression quality determines the tradeoff between file size and time taken to accomplish the compression.

Parameters:
filePath - pathname of the directory where the image need to be created
pageRange - pages whose contents need to be exported as TIFF
width - width of the images
height - height of the images
tiffCompressionType - constant specifying the compression type
tiffCompressionQuality - a number from 0.0 to 1.0 where 0.0 signifies that high compression is important while 1.0 signifies high image quality is important
scaleToResolution - resolution to which the page should be scaled before its contents are saved as an image
Throws:
PdfException - if Java Advanced Imaging API is not available; if called in PDF creation mode; if an invalid page range is supplied; if an invalid argument is supplied.
IOException - if an I/O error occurs.

saveDocAsTiffImage

public void saveDocAsTiffImage(String filePath,
                               String pageRange,
                               int tiffCompressionType,
                               float tiffCompressionQuality,
                               int scaleToResolution)
                        throws PdfException,
                               IOException
Exports specified pages as a multi-page TIFF image with specified pathname, compression type, compression quality and resolution. For lossy compression types, compression quality determines the tradeoff between file size and quality. For lossless compression types, compression quality determines the tradeoff between file size and time taken to accomplish the compression.

Parameters:
filePath - pathname of the directory where the image need to be created
pageRange - pages that need to be exported
tiffCompressionType - constant specifying the compression type
tiffCompressionQuality - a number from 0.0 to 1.0 where 0.0 signifies that high compression is important while 1.0 signifies high image quality is important
scaleToResolution - resolution to which the page should be scaled before its contents are saved as an image
Throws:
PdfException - if a resolution value from 11 to 4799 is not supplied; if an invalid page range is supplied; if Java Advanced Imaging API is not available; if called in PDF creation mode; if an invalid argument is supplied.
IOException - if an I/O error occurs.

saveAsImage

public void saveAsImage(String format,
                        String pageRange,
                        String imageName,
                        String outputPath)
                 throws IOException,
                        PdfException
Saves rasterized image of specified pages in specified format with specified pathname. If file name of the image is not specified or is null, then it will be constructed from the input document name and page number in the format: <document name>_page<page number>.<format>. If the document has been loaded from a stream, then the image file name will be constructed using a random number in the format: image_<5-digit random number>_page<page number>.<format>. The file name can also contain custom placeholders whose values can be provided in the implementation of the interface method PdfCustomPlaceholderHandler.onCustomPlaceHolder(). (Placeholders need to be delimited by <% and %>. Some placeholders have been pre-defined and values they provide are listed below:
  1. pageNo - number of the current page
  2. pageNum - number of the current page
  3. pageCount - total number of pages
  4. pageWidth - width of the current page
  5. pageHeight- height of the current page
  6. Author - "Author" document property
  7. Filename - file name of the document
  8. Path - location of the document
  9. FilePath - location of the document
  10. InputFileName - filename of the input document
  11. InputFilePath - path of the input document
  12. OutputFileName - filename of the output document
  13. OutputFilePath - path of the output document
If the PdfSaveAsImageHandler.onSaveAsImage() interface method is implemented, then the file name and path can also be changed just before the image is saved.

Parameters:
format - file name suffix of the image format
pageRange - pages whose images needs to created
imageName - prefix applied to file names of output images
outputPath - directory where images needs to be saved
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
See Also:
PdfSaveAsImageHandler, PdfProDocument.saveAsImage(String, String, String, String, String, float, String)
Sample Code
See example.

saveAsImage

public void saveAsImage(String format,
                        String pageRange,
                        String imageName,
                        String outputPath,
                        int scaleToResolution)
                 throws IOException,
                        PdfException
Saves rasterized image of specified pages in specified format with specified pathname and resolution. If file name of the image is not specified or is null, then it will be constructed from the input document name and page number in the format: <document name>_page<page number>.<format>. If the document has been loaded from a stream, then the image file name will be constructed using a random number in the format: image_<5-digit random number>_page<page number>.<format>. The file name can also contain custom placeholders whose values can be provided in the implementation of the interface method PdfCustomPlaceholderHandler.onCustomPlaceHolder(). (Placeholders need to be delimited by <% and %>. Some placeholders have been pre-defined and values they provide are listed below:
  1. pageNo - number of the current page
  2. pageNum - number of the current page
  3. pageCount - total number of pages
  4. pageWidth - width of the current page
  5. pageHeight- height of the current page
  6. Author - "Author" document property
  7. Filename - file name of the document
  8. Path - location of the document
  9. FilePath - location of the document
  10. InputFileName - filename of the input document
  11. InputFilePath - path of the input document
  12. OutputFileName - filename of the output document
  13. OutputFilePath - path of the output document
If the PdfSaveAsImageHandler.onSaveAsImage() interface method is implemented, then the file name and path can also be changed just before the image is saved.

Parameters:
format - file name suffix of the image format
pageRange - pages whose images needs to created
imageName - prefix applied to file names of output images
outputPath - directory where images needs to be saved
scaleToResolution - resolution to which the page should be scaled before its contents are saved as an image
Throws:
IOException - if an I/O error occurs.
PdfException - if a resolution value from 11 to 4799 is not supplied.

saveAsImage

public void saveAsImage(String format,
                        String pageRange,
                        String imageName,
                        float compressionQuality,
                        String outputPath)
                 throws IOException,
                        PdfException
Saves an image of specified pages in specified format with specified pathname, and compression quality.

Parameters:
format - file name suffix of the image format
pageRange - pages whose images needs to created
imageName - prefix applied to file names of output images
compressionQuality - a number from 0.0 to 1.0 where 0.0 signifies that high compression is important while 1.0 signifies high image quality is important
outputPath - directory where images needs to be saved
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
See Also:
PdfSaveAsImageHandler, PdfProDocument.saveAsImage(String, String, String, String, String, float, String)

saveAsImage

public void saveAsImage(String format,
                        String pageRange,
                        String imageName,
                        float compressionQuality,
                        String outputPath,
                        int scaleToResolution)
                 throws IOException,
                        PdfException
Saves an image of specified pages in specified format with specified pathname, compression quality and resolution.

Parameters:
format - file name suffix of the image format
pageRange - pages whose images needs to created
imageName - prefix applied to file names of output images
compressionQuality - a number from 0.0 to 1.0 where 0.0 signifies that high compression is important while 1.0 signifies high image quality is important
outputPath - directory where images needs to be saved
scaleToResolution - resolution to which the page should be scaled before its contents are saved as an image
Throws:
IOException - if an I/O error occurs.
PdfException - if a resolution value from 11 to 4799 is not supplied.

saveAsImage

public void saveAsImage(String format,
                        String pageRange,
                        String imageName,
                        int imageWidth,
                        int imageHeight,
                        float compressionQuality,
                        String outputPath)
                 throws IOException,
                        PdfException
Saves image of specified pages in specified format with specified pathname, width, height, compression type and compression quality. For lossy compression types, compression quality determines the tradeoff between file size and image quality. For lossless compression types, the compression quality determines the tradeoff between file size and time taken to perform the compression.

Parameters:
format - file name suffix of the image format
pageRange - pages whose images needs to created
imageName - prefix applied to file names of output images
imageWidth - width of output images
imageHeight - height of output images
compressionQuality - a number from 0.0 to 1.0 where 0 signifies that high compression is important and 1.0 signifies that high image quality is important
outputPath - directory where images needs to be saved
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
See Also:
PdfSaveAsImageHandler, PdfProDocument.saveAsImage(String, String, String, String, String, float, String)

saveAsImage

public void saveAsImage(String format,
                        String pageRange,
                        String imageName,
                        int imageWidth,
                        int imageHeight,
                        float compressionQuality,
                        String outputPath,
                        int scaleToResolution)
                 throws IOException,
                        PdfException
Saves image of specified pages in specified format with specified pathname, width, height, compression type, compression quality, and DPI. For lossy compression types, compression quality determines the tradeoff between file size and image quality. For lossless compression types, the compression quality determines the tradeoff between file size and time taken to perform the compression.

Parameters:
format - file name suffix of the image format
pageRange - pages whose images needs to created
imageName - prefix applied to file names of output images
imageWidth - width of output images
imageHeight - height of output images
compressionQuality - a number from 0.0 to 1.0 where 0 signifies that high compression is important and 1.0 signifies that high image quality is important
outputPath - directory where images needs to be saved
scaleToResolution - resolution to which the page should be scaled before its contents are saved as an image
Throws:
IOException - if an I/O error occurs.
PdfException - if a resolution value from 11 to 4799 is not supplied.

saveAsImage

public void saveAsImage(String format,
                        String pageRange,
                        String imageName,
                        int imageWidth,
                        int imageHeight,
                        float compressionQuality,
                        String compressionType,
                        String outputPath,
                        int scaleToResolution)
                 throws IOException,
                        PdfException
Throws:
IOException
PdfException

saveAsImage

public void saveAsImage(String format,
                        String pageRange,
                        String imageName,
                        String imageWidth,
                        String imageHeight,
                        float compressionQuality,
                        String outputPath)
                 throws IOException,
                        PdfException
Saves image of specified pages in specified format with specified pathname, width, height, and compression level. For lossy compression types, compression quality determines the tradeoff between file size and image quality. For lossless compression types, the compression quality determines the tradeoff between file size and time taken to perform the compression.

Parameters:
format - file name suffix of the image format
pageRange - pages whose images needs to created
imageName - prefix of file names of output images
imageWidth - placeholder with the width of output images
imageHeight - height of output images
compressionQuality - a number from 0.0 to 1.0 where 0 signifies that high compression is important and 1.0 signifies that high image quality is important
outputPath - directory where images needs to be saved
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
See Also:
PdfSaveAsImageHandler, PdfProDocument.saveAsImage(String, String, String, String, String, float, String)

saveAsImage

public void saveAsImage(String format,
                        String pageRange,
                        String imageName,
                        String imageWidth,
                        String imageHeight,
                        float compressionQuality,
                        String outputPath,
                        int scaleToResolution)
                 throws IOException,
                        PdfException
Saves image of specified pages in specified format with specified pathname, width, height, compression level, and resolution. For lossy compression types, compression quality determines the tradeoff between file size and image quality. For lossless compression types, the compression quality determines the tradeoff between file size and time taken to perform the compression.

Parameters:
format - file name suffix of the image format
pageRange - pages whose images needs to created
imageName - prefix of file names of output images
imageWidth - placeholder with the width of output images
imageHeight - height of output images
compressionQuality - a number from 0.0 to 1.0 where 0 signifies that high compression is important and 1.0 signifies that high image quality is important
outputPath - directory where images needs to be saved
scaleToResolution - resolution to which the page should be scaled before its contents are saved as an image
Throws:
IOException - if an I/O error occurs.
PdfException - if a resolution value from 11 to 4799 is not supplied.

saveAsImage

public void saveAsImage(String format,
                        String pageRange,
                        String imageName,
                        float compressionQuality,
                        String outputPath,
                        int scaleToResolution,
                        double zoom)
                 throws PdfException,
                        IOException
Throws:
PdfException
IOException

saveAsImage

public void saveAsImage(String format,
                        String pageRange,
                        String imageName,
                        float compressionQuality,
                        String compressionType,
                        String outputPath,
                        int scaleToResolution,
                        double zoom)
                 throws PdfException,
                        IOException
Throws:
PdfException
IOException

getSupportedCompressionTypes

public String[] getSupportedCompressionTypes(String format)
                                      throws PdfException
Returns a list of compression methods used for specified image format.

Parameters:
format - image format
Returns:
a list of compression methods
Throws:
PdfException - if an illegal argument is supplied.

isImageFomatandCompressionLossless

public boolean isImageFomatandCompressionLossless(String imageFormat,
                                                  String compressionType)
                                           throws PdfException
Returns whether specified compresion method for specified image format is lossless.

Parameters:
imageFormat - image format
compressionType - compression method
Returns:
whether the compression method is lossless
Throws:
PdfException - if an illegal argument is supplied.

getPageElements

public List getPageElements(int pageNum,
                            int elementTypes)
                     throws PdfException,
                            IOException
Returns a list of page elements of specified type in specified page.

Parameters:
pageNum - number of page
elementTypes - constant or a combination of constants specifying the type of the page elements
Returns:
list of page elements
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.

getPageElements

public List getPageElements(String pageRange,
                            int elementTypes)
                     throws PdfException,
                            IOException
Returns list of all page elements of specified type in specified page range.

Parameters:
pageRange - pages whose page elements need to be retrieved
elementTypes - constant or a combination of constants specifying the type of the page elements
Returns:
list of all page elements
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.

enumPageElements

public void enumPageElements(int pageNum,
                             int elementTypes,
                             PdfEnumPageElementsHandler pdfEnumPageElementsHandler)
                      throws PdfException,
                             IOException
Parse contents of specified page and call onEnumPageElements() event handler of specified user-class instance whenever a page element of specified type is encountered.

Parameters:
pageNum - number of the page whose page elements need to be parsed
elementTypes - types of page elements that need to be found
pdfEnumPageElementsHandler - user-class instance whose onEnumPageElements() event handler needs to be called
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.

enumPageElements

public void enumPageElements(String pageRange,
                             int elementTypes,
                             PdfEnumPageElementsHandler pdfEnumPageElementsHandler)
                      throws PdfException,
                             IOException
Parse contents of specified pages and call onEnumPageElements() event handler of specified user-class instance whenever a page element of specified type is encountered.

Parameters:
pageRange - pages whose contents need to be parsed
elementTypes - types of page elements that need to be found
pdfEnumPageElementsHandler - user-class instance whose onEnumPageElements() event handler needs to be called
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.

redactRegion

public void redactRegion(String pageRange,
                         PdfRect boundingRect,
                         boolean clipRegion,
                         PdfPen pen,
                         PdfBrush brush,
                         boolean isStroke,
                         boolean isFill)
                  throws PdfException,
                         IOException
Redacts all text in specified region in specified pages.

Parameters:
pageRange - pages where the specified region needs to be redacted
boundingRect -
clipRegion -
pen - pen with which the region needs to be stroked
brush - brush which which the region needs to be filled
isStroke - whether the region needs to be stroked
isFill - whether the region needs to be filled
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.

redactRegion

public void redactRegion(String pageRange,
                         PdfRect boundingRect,
                         boolean includeIntersectingText,
                         boolean clipRegion,
                         PdfPen pen,
                         PdfBrush brush,
                         boolean isStroke,
                         boolean isFill)
                  throws PdfException,
                         IOException
Redact all text within specified rectangle and if required remove even characters that fall partially outside the rectangle.

Parameters:
pageRange - pages where the specified region needs to be redacted
boundingRect - area where text needs to be redacted
includeIntersectingText - whether characters that fall only partially within rectangle also need to be redacted
clipRegion -
pen - pen with which the region needs to be stroked
brush - brush which which the region needs to be filled
isStroke - whether the region needs to be stroked
isFill - whether the region needs to be filled
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.

redactText

public void redactText(int pageNum,
                       String searchString,
                       int searchMode,
                       int searchOptions)
                throws PdfException,
                       IOException
Redacts all instances of specified text in specified page.

Parameters:
pageNum - number of the page
searchString - strings whose instances in the page need to be redacted
searchMode - PdfSearchMode constant specifying whether the search string is a simple text string or a regular expression
searchOptions - PdfSearchOptions constant specify search options
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.

redactText

public void redactText(int pageNum,
                       String searchString,
                       int searchMode,
                       int searchOptions,
                       PdfPen pen,
                       PdfBrush brush,
                       boolean isStroke,
                       boolean isFill)
                throws PdfException,
                       IOException
Redacts all instances of specified text in specified page and fills/strokes the redacted region if specified.

Parameters:
pageNum - number of the page
searchString - strings whose instances in the page need to be redacted
searchMode - PdfSearchMode constant specifying whether the search string is a simple text string or a regular expression
searchOptions - PdfSearchOptions constant specify search options
pen - pen with which the region needs to be stroked
brush - brush which which the region needs to be filled
isStroke - whether the redacted region needs to be stroked
isFill - whether the redacted region needs to be filled
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.

redactText

public void redactText(String pageRange,
                       String searchString,
                       int searchMode,
                       int searchOptions)
                throws PdfException,
                       IOException
Redacts all instances of specified text in specified pages.

Parameters:
pageRange - pages where the text needs to be redacted
searchString - strings whose instances in the page need to be redacted
searchMode - PdfSearchMode constant specifying whether the search string is a simple text string or a regular expression
searchOptions - PdfSearchOptions constant specify search options
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.

redactText

public void redactText(String pageRange,
                       String searchString,
                       int searchMode,
                       int searchOptions,
                       PdfPen pen,
                       PdfBrush brush,
                       boolean isStroke,
                       boolean isFill)
                throws PdfException,
                       IOException
Redacts all instances of specified text in specified pages and fills/strokes the region if specified.

Parameters:
pageRange - pages where the text needs to be redacted
searchString - strings whose instances in the page need to be redacted
searchMode - PdfSearchMode constant specifying whether the search string is a simple text string or a regular expression
searchOptions - PdfSearchOptions constant specify search options
pen - pen with which the region needs to be stroked
brush - brush which which the region needs to be filled
isStroke - whether the redacted region needs to be stroked
isFill - whether the redacted region needs to be filled
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.

setSaveAsImageHandler

public void setSaveAsImageHandler(PdfSaveAsImageHandler saveAsImageHandler)
Ensures that the onSaveAsImage() event handler of specified user-class instance is called whenever a page is exported as an image.

Parameters:
saveAsImageHandler - user-class instance whose onSaveAsImage() event handler needs to be called
See Also:
PdfProDocument.saveAsImage(String, String, String, float, String, String, int, double)

setRenderErrorHandler

public void setRenderErrorHandler(PdfRenderErrorHandler pdfRenderErrorHandler)
Ensures that the onRenderError() event handler of specified user-class instance is called whenever a rendering error occurs.

Parameters:
pdfRenderErrorHandler - user-class instance whose onRenderError() event handler needs to be called
See Also:
PdfProDocument.getRenderErrorHandler()

getRenderErrorHandler

public PdfRenderErrorHandler getRenderErrorHandler()
Returns current user-class instance whose onRenderError() event handler has been set to be called by this document object.

Returns:
user-class instance whose onRenderError() event handler has been set to be called

close

public void close()
           throws IOException,
                  PdfException
Description copied from class: com.gnostice.pdfone.PdfStdDocument
Closes loaded document and frees I/O resources associated with it.

Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.
See Also:
PdfStdDocument.load(String), PdfStdDocument.save(String)

getRenderingOptions

public PdfRenderingOptions getRenderingOptions()
Returns current rendering options of the document.

Returns:
current rendering options

setRenderingOptions

public void setRenderingOptions(PdfRenderingOptions renderingOptions)
Set specified rendering options for the document.

Parameters:
renderingOptions - rendering options that need to be set for the document

search

public List search(String searchString,
                   int pageNum,
                   int searchMode,
                   int searchOptions)
            throws PdfException,
                   IOException
Returns all lines of text that contains specified search string in specified page.

Parameters:
searchString - text that needs to be searched for
pageNum - number of the page where the search needs to be performed
searchMode - PdfSearchMode constant specifying whether the search string is a simple text string or a regular expression
searchOptions - PdfSearchOptions constant specify search options
Returns:
list of search results
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.

search

public List search(String searchString,
                   String pageRange,
                   int searchMode,
                   int searchOptions)
            throws PdfException,
                   IOException
Throws:
PdfException
IOException

search

public List search(int startPageNum,
                   String searchString,
                   int searchMode,
                   int searchOptions)
            throws PdfException,
                   IOException
Returns a list of all lines of text that contain specified search text string (in and after specified page).

Parameters:
startPageNum - number of the page from which the search should begin
searchString - text that needs to be searched for
searchMode - PdfSearchMode constant specifying whether the search string is a simple text string or a regular expression
searchOptions - PdfSearchOptions constant specify search options
Returns:
list of search results
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.

search

public void search(String searchString,
                   int searchMode,
                   int searchOptions,
                   PdfSearchHandler pdfSearchHandler,
                   int startPageNum)
            throws PdfException,
                   IOException
Searches specified search string in specified page and calls onSearchElement() event handler of specified user-class instance when a line containing specified search text string is found.

Parameters:
searchString - text that needs to be searched for
searchMode - PdfSearchMode constant specifying whether the search string is a simple text string or a regular expression
searchOptions - PdfSearchOptions constant specify search options
pdfSearchHandler - user-class instance whose onSearchElement() needs to be called
startPageNum - number of the page from which the search should begin
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.

search

public void search(String searchString,
                   int searchMode,
                   int searchOptions,
                   PdfSearchHandler pdfSearchHandler,
                   String pageRange)
            throws PdfException,
                   IOException
Throws:
PdfException
IOException

search

public List search(List searchStringList,
                   int pageNum,
                   int searchMode,
                   int searchOptions)
            throws PdfException,
                   IOException
Throws:
PdfException
IOException

search

public List search(List searchStringList,
                   String pageRange,
                   int searchMode,
                   int searchOptions)
            throws PdfException,
                   IOException
Throws:
PdfException
IOException

findFirst

public PdfSearchElement findFirst(String searchString,
                                  int searchMode,
                                  int searchOptions,
                                  int startPageNum,
                                  boolean isSearchForward)
                           throws PdfException,
                                  IOException
Returns first page element that is found for the search for specified text.

Parameters:
searchString - text that needs to be searched for
searchMode - PdfSearchMode constant specifying whether the search string is a simple text string or a regular expression
searchOptions - PdfSearchOptions constant specify search options
startPageNum - number of the page from which the search should begin
isSearchForward - whether search should move towards the end of the document
Returns:
first result of the search
Throws:
PdfException - if an I/O error occurs.
IOException - if an illegal argument is supplied.

findNext

public PdfSearchElement findNext(PdfSearchElement currentSearchElement)
                          throws PdfException,
                                 IOException
Returns page element found by the search operation immediately after specified search element.

Parameters:
currentSearchElement - page element search result whose successor needs to be found
Returns:
next search result
Throws:
PdfException - if an I/O error occurs.
IOException - if an illegal argument is supplied.

findPrevious

public PdfSearchElement findPrevious(PdfSearchElement currentSearchElement)
                              throws PdfException,
                                     IOException
Returns page element found by the search operation immediately prior to specified search element.

Parameters:
currentSearchElement - page element search result whose predecessor needs to be found
Returns:
previous search result
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.

extractText

public List extractText(int pageNum)
                 throws PdfException,
                        IOException
Returns a list containing lines of text extracted from specified page.

Parameters:
pageNum - number of the page
Returns:
containing the extracted text
Throws:
PdfException - if an I/O error occurs.
IOException - if an illegal argument is supplied.

extractText

public List extractText(String pageRange,
                        boolean insertPageBreak)
                 throws PdfException,
                        IOException
Returns a list containing lines of text extracted from specified pages.

Parameters:
pageRange - pages whose text need to be extracted
insertPageBreak - whether a new line need to be inserted when the text extraction operation moves to a new page
Returns:
list containing the extracted text
Throws:
PdfException - if an I/O error occurs.
IOException - if an illegal argument is supplied.

saveAsText

public void saveAsText(int pageNum,
                       Writer writer)
                throws PdfException,
                       IOException
Exports all text of specified page and saves it to specified writer instance.

Parameters:
pageNum - number of the page
writer - stream writer instance to which the text needs to be saved
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.

saveAsText

public void saveAsText(int pageNum,
                       Writer writer,
                       boolean ignoreExtraNewLines)
                throws PdfException,
                       IOException
Exports all text (after ignoring extra blank lines) of specified page and saves it to specified writer instance.

Parameters:
pageNum - number of the page
writer - stream writer instance to which the text needs to be saved
ignoreExtraNewLines - whether consecutive blank lines need to be exported
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.

saveAsText

public void saveAsText(String pageRange,
                       Writer writer,
                       boolean insertPageBreak,
                       boolean ignoreExtraNewLines)
                throws PdfException,
                       IOException
Exports all text from specified pages (excluding consecutive blank lines and including a new line for each new page) and writes to the specified text writer object.

Parameters:
pageRange - pages from which text needs to be exported
writer - stream writer instance to which the text needs to be saved
insertPageBreak - whether consecutive blank lines need to be exported
ignoreExtraNewLines - whether consecutive blank lines need to be exported
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.

saveAsText

public void saveAsText(String pageRange,
                       Writer writer,
                       boolean insertPageBreak)
                throws PdfException,
                       IOException
Exports all text of specified pages and saves it to specified writer instance (after ignoring extra blank lines).

Parameters:
pageRange - pages from which the text needs to be exported
writer - stream writer instance to which the text needs to be saved
insertPageBreak - whether consecutive blank lines need to be exported
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.

addSignature

public void addSignature(String PFXFileName,
                         String PFXPassword,
                         String reason,
                         String location,
                         String contactInfo,
                         int pageNum)
                  throws PdfException,
                         IOException
Adds a hidden signature to the document using digital certificate loaded from specified file.

Parameters:
PFXFileName - PFX file from which the digital certificate needs to be loaded
PFXPassword - password with which the certificate needs to be read
reason - text that needs to be identified as the "reason" for the signature
location - text that needs to be assigned as the "location" for the signature
contactInfo - text that needs to be assigned as the "contact information" for the signature
pageNum - number of the page where the signature needs to be added
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.

addSignature

public void addSignature(String PFXFileName,
                         String PFXPassword,
                         String reason,
                         String location,
                         String contactInfo,
                         int pageNum,
                         Date timeStamp)
                  throws PdfException,
                         IOException
Adds a hidden signature with specified timestamp to the document using digital certificate loaded from specified file.

Parameters:
PFXFileName - PFX file from which the digital certificate needs to be loaded
PFXPassword - password with which the certificate needs to be read
reason - text that needs to be assigned as the "reason" for the signature
location - text that needs to be assigned as the "location" for the signature
contactInfo - text that needs to be assigned as the "contact information" for the signature
pageNum - number of the page where the signature needs to be added
timeStamp - time stamp that needs to be set for the signature
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.

addSignature

public void addSignature(String PFXFileName,
                         String PFXPassword,
                         String reason,
                         String location,
                         String contactInfo,
                         int pageNum,
                         String fieldName)
                  throws PdfException,
                         IOException
Adds a hidden signature on specified page with specified field name, reason, location, and contact information.

Parameters:
PFXFileName - PFX file from which the digital certificate needs to be loaded
PFXPassword - password with which the certificate needs to be read
reason - text that needs to be identified as the "reason" for the signature
location - text that needs to be assigned as the "location" for the signature
contactInfo - text that needs to be assigned as the "contact information" for the signature
pageNum - number of the page where the signature needs to be added
fieldName - name that needs to be set for the signature form field in the document
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.

addSignature

public void addSignature(String PFXFileName,
                         String PFXPassword,
                         String reason,
                         String location,
                         String contactInfo,
                         int pageNum,
                         String fieldName,
                         PdfRect fieldRect)
                  throws PdfException,
                         IOException
Adds a signature form field at specified location.

Parameters:
PFXFileName - PFX file from which the digital certificate needs to be loaded
PFXPassword - password with which the certificate needs to be read
reason - text that needs to be identified as the "reason" for the signature
location - text that needs to be assigned as the "location" for the signature
contactInfo - text that needs to be assigned as the "contact information" for the signature
pageNum - number of the page where the signature needs to be added
fieldName - time stamp that needs to be set for the signature
fieldRect - name that needs to be set for the signature form field in the document
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.

addSignature

public void addSignature(String PFXFileName,
                         String PFXPassword,
                         String reason,
                         String location,
                         String contactInfo,
                         int pageNum,
                         String fieldName,
                         PdfRect fieldRect,
                         Color backgroundColor,
                         PdfFont font)
                  throws PdfException,
                         IOException
Adds a signature form field at specified location with specified background color and font.

Parameters:
PFXFileName - PFX file from which the digital certificate needs to be loaded
PFXPassword - password with which the certificate needs to be read
reason - text that needs to be identified as the "reason" for the signature
location - text that needs to be assigned as the "location" for the signature
contactInfo - text that needs to be assigned as the "contact information" for the signature
pageNum - number of the page where the signature needs to be added
fieldName - name that needs to be set for the signature form field in the document
fieldRect - location on the page where the signature form field needs to be added
backgroundColor - background color of the signature form field
font - font with which the signature needs to be displayed
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.

addSignature

public void addSignature(String PFXFileName,
                         String PFXPassword,
                         String reason,
                         String location,
                         String contactInfo,
                         int pageNum,
                         Date timeStamp,
                         String fieldName,
                         PdfRect fieldRect)
                  throws PdfException,
                         IOException
Adds a signature form field at specified location and with specified timestamp.

Parameters:
PFXFileName - PFX file from which the digital certificate needs to be loaded
PFXPassword - password with which the certificate needs to be read
reason - text that needs to be assigned as the "reason" for the signature
location - text that needs to be assigned as the "location" for the signature
contactInfo - text that needs to be assigned as the "contact information" for the signature
pageNum - number of the page where the signature needs to be added
timeStamp - time stamp that needs to be set for the signature
fieldName - name that needs to be set for the signature form field in the document
fieldRect - location on the page where the signature form field needs to be added
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.

addSignature

public void addSignature(String PFXFileName,
                         String PFXPassword,
                         String reason,
                         String location,
                         String contactInfo,
                         int pageNum,
                         Date timeStamp,
                         String fieldName,
                         PdfRect fieldRect,
                         Color backgroundColor,
                         PdfFont font)
                  throws PdfException,
                         IOException
Adds a signature form field with specified background color and font.

Parameters:
PFXFileName - PFX file from which the digital certificate needs to be loaded
PFXPassword - password with which the certificate needs to be read
reason - text that needs to be identified as the "reason" for the signature
location - text that needs to be assigned as the "location" for the signature
contactInfo - text that needs to be assigned as the "contact information" for the signature
pageNum - number of the page where the signature needs to be added
timeStamp - time stamp that needs to be set for the signature
fieldName - name that needs to be set for the signature form field in the document
fieldRect - location on the page where the signature form field needs to be added
backgroundColor - background color of the signature form field
font - font with which the signature needs to be displayed
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.

addSignature

public void addSignature(String PFXFileName,
                         String PFXPassword,
                         String reason,
                         String location,
                         String contactInfo,
                         int pageNum,
                         Date timeStamp,
                         String fieldName,
                         PdfRect fieldRect,
                         PdfAppearanceStream fieldAppearanceStream)
                  throws PdfException,
                         IOException
Adds a signature form field with specified background color, font and appearance stream.

Parameters:
PFXFileName - PFX file from which the digital certificate needs to be loaded
PFXPassword - password with which the certificate needs to be read
reason - text that needs to be assigned as the "reason" for the signature
location - text that needs to be assigned as the "location" for the signature
contactInfo - text that needs to be assigned as the "contact information" for the signature
pageNum - number of the page where the signature needs to be added
timeStamp - time stamp that needs to be set for the signature
fieldName - name that needs to be set for the signature form field in the document
fieldRect - location on the page where the signature form field needs to be added
fieldAppearanceStream - custom appearance stream for the form field
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.

addSignature

public void addSignature(PdfSignature pdfSignature)
                  throws PdfException,
                         IOException
Adds specified digital signature to the document.

Parameters:
pdfSignature - digital signature that needs to be added
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.

removeAllSignaures

public void removeAllSignaures()
                        throws IOException,
                               PdfException
Remove all signatures from the document.

Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.

load

public void load(String strFilePath)
          throws IOException,
                 PdfException
Loads PDF document in specified path. The loaded document can then be printed, displayed, modified, or saved.

Parameters:
strFilePath - pathname of the PDF document
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
See Also:
PdfStdDocument.save(String), PdfStdDocument.close()

load

public void load(File inFile)
          throws IOException,
                 PdfException
Loads PDF document specified by a java.io.File object. The loaded document can then be printed, displayed, modified, or saved.

Parameters:
inFile - PDF document that needs to be loaded
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
See Also:
PdfStdDocument.save(String), PdfStdDocument.close()

load

public void load(FileInputStream fileInputStream)
          throws IOException,
                 PdfException
Loads PDF document specified by a java.io.FileInputStream object. The loaded docuement can then be printed, displayed, modified, or saved.

Parameters:
fileInputStream - PDF document that needs to be loaded
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
See Also:
PdfStdDocument.save(String), PdfStdDocument.close()

load

public void load(InputStream inputStream)
          throws IOException,
                 PdfException
Throws:
IOException
PdfException

load

public void load(byte[] byteArray)
          throws IOException,
                 PdfException
Loads a PDF document from a byte array. The loaded document can then be printed, displayed, modified, or saved.

Parameters:
byteArray - PDF document that needs to be loaded.
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
See Also:
PdfStdDocument.save(String), PdfStdDocument.close()

setOnPasswordHandler

public void setOnPasswordHandler(PdfPasswordHandler onPasswordHandler)
Ensures that onPassword() event handler of specified user-class instance is called when a password is required to read a document. Use the event handler to provide the password.

Parameters:
onPasswordHandler - user-class instance whose onPassword() needs to be called

setOnPageReadHandler

public void setOnPageReadHandler(PdfPageReadHandler onPageReadHandler)
Ensures that the onPageRead() event handler of specified user-class instance is called when a new page is read from the document. Use the event handler to specify margins for content-rendering operations on the loaded document.

Parameters:
onPageReadHandler - user-class instance whose onPageRead() event handler needs to be called

addPdfDocumentChangeHandler

public void addPdfDocumentChangeHandler(PdfDocumentChangeHandler pdfDocumentChangeHandler)
Ensures that the specified user class instance is notified when the document object opens or closes a PDF document. The document object maintains a list of instances that implement PdfDocumentChangeHandler event handler methods. When the document object opens or closes a document, it calls the event handlers for all user class instances on that list.

Parameters:
pdfDocumentChangeHandler - user class instance whose event handlers need to be called
See Also:
PdfStdDocument.removePdfDocumentChangeHandler(PdfDocumentChangeHandler)

removePdfDocumentChangeHandler

public boolean removePdfDocumentChangeHandler(PdfDocumentChangeHandler pdfDocumentChangeHandler)
Ensures that the onLoad() and onClose() event handlers of specified user-class instance are no longer.

Parameters:
pdfDocumentChangeHandler - user-class instance whose onLoad()} and onClose()} event handlers are not required to be called
Returns:
true if successful; false if otherwise or the event handlers were not currently set up to be called
See Also:
PdfStdDocument.addPdfDocumentChangeHandler(PdfDocumentChangeHandler)

getEncryptor

public PdfEncryption getEncryptor()
Retrieves current encryption settings of this PdfDocument.

Returns:
a PdfEncryption object identifying the current encryption settings of the document
Since:
1.0
See Also:
PdfStdDocument.setEncryptor(PdfEncryption)
Sample Code
See example.

setEncryptor

public void setEncryptor(PdfEncryption encrypto)
                  throws PdfException
Specify encryption settings for this PdfDocument.

Parameters:
encrypto - PdfEncryption specifying the encryption settings for the document
Throws:
PdfException - if an illegal argument is supplied.
Since:
1.0
See Also:
PdfStdDocument.getEncryptor()
Sample Code
See example.

isEncrypted

public boolean isEncrypted()
Returns whether the document is encrypted.

Returns:
whether the document is encrypted

addAction

public void addAction(int actionType,
                      String applicationToLaunch,
                      boolean isPrint,
                      String parameterToApplication)
               throws IOException,
                      PdfException
Add a document-level action for launching a specified application with specified parameters or open/print specified document.

Parameters:
actionType - always PdfAction.LAUNCH
applicationToLaunch - pathname of the application or the document
isPrint - whether the document needs to be printed instead of being opened
parameterToApplication - arguments with which the application needs to be launched
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.

addAction

public void addAction(int actionType,
                      String javascriptOrURI)
               throws IOException,
                      PdfException
Sets this document to execute action specified by javascriptOrURI when the document is displayed.

Parameters:
actionType - constant specifying the type of action that needs to be executed
javascriptOrURI - Javascript statement or Uniform Resource Indicator (URI) that needs to be executed
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
See Also:
PdfAction.JAVASCRIPT, PdfAction.URI
Sample Code
See example.

addAction

public void addAction(int event,
                      int actionType,
                      String javascript)
               throws IOException,
                      PdfException
Adds a Javascript action to specified document-level event.

Parameters:
event - constant specifying the event
actionType - constant identifying the action as a Javascript action, that is, PdfAction.JAVASCRIPT.
javascript - JavaScript script that needs to be executed by the action
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
See Also:
PdfAction.PdfEvent
Sample Code
See example.

addAction

public void addAction(int namedAction)
Adds a named action that needs to be executed by viewer applications when they display the document.

namedAction Viewer Effect
PdfAction.NAMED_FIRSTPAGE Navigates to the first page
PdfAction.NAMED_LASTPAGE Navigates to the last page
PdfAction.NAMED_NEXTPAGE Navigates to the next page
PdfAction.NAMED_PREVPAGE Navigates to the previous page

Parameters:
namedAction - constant specifying named action
Since:
1.0
See Also:
PdfAction
Sample Code
See example.

addAction

public void addAction(int actionType,
                      int pageNum)
               throws IOException,
                      PdfException
Adds a go-to action to the document. The action is executed when the document is opened in the viewer.

Parameters:
actionType - constant that identifies the action as a go-to action, that is, PdfAction.GOTO.
pageNum - number of the page to which the viewer should navigate when the document is opened
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
See Also:
PdfAction
Sample Code
See example.

addAction

public void addAction(int actionType,
                      int pageNum,
                      float x,
                      float y,
                      float zoomPercentage)
               throws IOException,
                      PdfException
Adds a go-to action of specified type to specified page with destination set to specified location and magnification.

Parameters:
actionType - always PdfAction.GOTO
pageNum - number of the page where the destination is located
x - x-coordinate of the destination
y - y-coordinate of the destination
zoomPercentage - magnification with which the destination needs to be displayed
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.

addAction

public void addAction(PdfGotoAction gotoAction)
               throws IOException,
                      PdfException
Adds specified document-level go-to PDF action to document. This method allows you to make the viewer application execute the go-to action when the document is opened for the first time.

Parameters:
gotoAction - go-to PDF action that needs to be added
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.

setProducer

public void setProducer(String s)
Deprecated. No replacement


getProducer

public String getProducer()
Returns "producer" document property of the document.

Returns:
"producer" document property of the document
See Also:
PdfStdDocument.setProducer(String)

getCreationDate

public Date getCreationDate()
Returns "creation date" document property for this property.

Returns:
"creation date" document property for this property

setCreationDate

public void setCreationDate(Date date)
Sets "creation date" document information property.

Parameters:
date - date that needs to be set as the "creation date" document information property
See Also:
PdfStdDocument.getCreationDate(), PdfStdDocument.setModifiedDate(Date)

getModifiedDate

public Date getModifiedDate()
Return "modified date" documentation property of this document.

Returns:
"modified date" documentation property of this document

setModifiedDate

public void setModifiedDate(Date date)
Set "modified date" document information property.

Parameters:
date - date that needs to be set as the "modified date" document information property
See Also:
PdfStdDocument.getModifiedDate(), PdfStdDocument.setCreationDate(Date)

save

public long save(String outFilePath)
          throws IOException,
                 PdfException
Save loaded document with specified pathname.

Parameters:
outFilePath - pathname to which the document needs to be saved
Returns:
size of the saved document
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.

save

public long save(File outFile)
          throws IOException,
                 PdfException
Save loaded document to specified file object.

Parameters:
outFile - file object to which the document needs to be saved
Returns:
size of the saved document
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.

save

public long save(OutputStream outputStream)
          throws IOException,
                 PdfException
Save loaded document to specified output stream object.

Parameters:
outputStream - output stream to which the document needs to be saved
Returns:
size of the saved document
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.

write

public long write()
           throws IOException,
                  PdfException
Deprecated. Use one of the save() overloaded methods instead.

Save contents in this PdfDocument to the PdfDocument's output stream or file and returns number of bytes that was saved.

Returns:
number of bytes that was saved to the output stream or file
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

setCropBox

public void setCropBox(double cropLeft,
                       double cropTop,
                       double cropRight,
                       double cropBottom,
                       String pageRange)
                throws PdfException,
                       IOException
Sets crop box of specified pages.

Parameters:
cropLeft - distance between the left edge of the crop box and the left edge of the page
cropTop - distance between the top edge of the crop box and the top edge of the page
cropRight - distance between the right edge of the crop box and the right edge of the page
cropBottom - distance between the bottom edge of the crop box and the bottom edge of the page
pageRange - pages whose crop box need to be set
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.
Since:
3.5.2.12

setCropBox

public void setCropBox(double cropLeft,
                       double cropTop,
                       double cropRight,
                       double cropBottom,
                       int unit,
                       String pageRange)
                throws PdfException,
                       IOException
Sets crop box of specified pages in specified measurement unit.

Parameters:
cropLeft - distance between the left edge of the crop box and the left edge of the page
cropTop - distance between the top edge of the crop box and the top edge of the page
cropRight - distance between the right edge of the crop box and the right edge of the page
cropBottom - distance between the bottom edge of the crop box and the bottom edge of the page
unit - measurement unit with which the position of the edges of the crop box are specified
pageRange - pages whose crop box need to be set
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.
Since:
3.5.2.12

setCropBox

public void setCropBox(PdfRect rect,
                       String pageRange)
                throws PdfException,
                       IOException
Sets specified rectangular area as the crop box for specified pages.

Parameters:
rect - rectangular area that needs to be set as the crop box
pageRange - pages whose crop box need to be set
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.
Since:
3.5.2.12

setCropBox

public void setCropBox(PdfRect rect,
                       int unit,
                       String pageRange)
                throws PdfException,
                       IOException
Set specified rectangular area in specified measurement unit as the crop box for specified pages.

Parameters:
rect - rectangular area that needs to be set as the crop box
unit - measurement unit in which the rectangulare area is specified
pageRange - pages whose crop box need to be set
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.
Since:
3.5.2.12

getCompressionLevel

public int getCompressionLevel()
Returns constant identifying compression level of this Pdfdocument.

Returns:
constant identifying the compression level
Since:
1.0
See Also:
PdfStdDocument.setCompressionLevel(int), PdfFlateFilter
Sample Code
See example.

setCompressionLevel

public void setCompressionLevel(int compressionLevel)
Specifies compression level for this PdfDocument.

Parameters:
compressionLevel - constant specifying the compression level
Since:
1.0
See Also:
PdfStdDocument.getCompressionLevel(), PdfFlateFilter
Sample Code
See example.

setWriter

public void setWriter(PdfWriter w)
               throws PdfException
Deprecated. No replacement

Throws:
PdfException

setReader

public void setReader(PdfReader r)
               throws IOException,
                      PdfException
Deprecated. No replacement

Throws:
IOException
PdfException

getReader

public PdfReader getReader()
Deprecated. No replacement


getWriter

public PdfWriter getWriter()
Deprecated. No replacement


getWriterOutputFile

public File getWriterOutputFile()
Returns output file specified for this document.

Returns:
output file specified for this document

getPage

public PdfPage getPage(int pageNo)
                throws PdfException,
                       IOException
Returns a PdfPage object specified by page number in this document.

Parameters:
pageNo - page number in the document
Returns:
a PdfPage object
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

getPageCount

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

Returns:
number of pages
Since:
1.0
Sample Code
See example.

setPenWidth

public void setPenWidth(double width)
Specifies default width for this PdfDocument's pen.

Parameters:
width - default width for the PdfDocument's pen
Since:
1.0
Sample Code
See example.

setPenDashLength

public void setPenDashLength(double length)
Specifies length of dashes in default dash pattern of this PdfDocument's pen.

Parameters:
length - length of dashes in the default dash pattern
Since:
1.0
See Also:
PdfStdDocument.setPenDashGap(double), PdfStdDocument.setPenDashPhase(double)
Sample Code
See example.

setPenDashGap

public void setPenDashGap(double gap)
Specifies length of gaps in default dash pattern of this PdfDocument's pen.

Parameters:
gap - length of gaps in the default dash pattern
Since:
1.0
See Also:
PdfStdDocument.setPenDashLength(double), PdfStdDocument.setPenDashPhase(double)
Sample Code
See example.

setPenDashPhase

public void setPenDashPhase(double phase)
Specifies length of phase of default dash pattern of this PdfDocument's pen.

Parameters:
phase - length of phase of the default dash pattern
Since:
1.0
See Also:
PdfStdDocument.setPenDashGap(double), PdfStdDocument.setPenDashLength(double)
Sample Code
See example.

setPenCapStyle

public void setPenCapStyle(int capStyle)
Specifies default shape of endpoints of paths in this PdfDocument.

Parameters:
capStyle - constant specifying the default shape
Since:
1.0
See Also:
PdfPen, PdfStdDocument.setPenJoinStyle(int)
Sample Code
See example.

setPenJoinStyle

public void setPenJoinStyle(int joinStyle)
Specifies default shape of joints of paths that connect at an angle for this PdfDocument's pen.

Parameters:
joinStyle - constant specifying the default shape
Since:
1.0
See Also:
PdfPen, PdfStdDocument.setPenCapStyle(int)
Sample Code
See example.

setPenMiterLimit

public void setPenMiterLimit(int limit)
Specifies default miter limit for this PdfDocument's pen.

Parameters:
limit - default miter limit for the PdfDocument's pen
Since:
1.0
See Also:
PdfPen
Sample Code
See example.

getXMLMetadata

public String getXMLMetadata()
                      throws IOException,
                             PdfException
Returns XML metadata of this PdfDocument.

Returns:
XML metadata of the document
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

disableAllMargins

public void disableAllMargins(String pageRange)
                       throws PdfException
Disables all margins on pages in specified page range.

Parameters:
pageRange - page range on whose pages margins need to disabled
Throws:
PdfException - if an illegal argument is supplied.
Since:
1.0
See Also:
PdfStdDocument.enableAllMargins(String)
Sample Code
See example.

enableAllMargins

public void enableAllMargins(String pageRange)
                      throws PdfException
Enables all margins on pages in specified page range.

Parameters:
pageRange - page range on whose pages margins need to enabled
Throws:
PdfException - if an illegal argument is supplied.
Since:
1.0
See Also:
PdfStdDocument.enableAllMargins(String)
Sample Code
See example.

addToFiltersList

public void addToFiltersList(int filter)
Adds a filter to the list of filters used to encode stream objects in this document.

Multiple filters can be added to the list of filters for a single document. Filters will be applied in the order they were added.

Parameters:
filter - filter to be added
Since:
1.0
See Also:
PdfFilter
Sample Code
See example.

appendPagesFrom

public void appendPagesFrom(PdfDocument d,
                            String pageRange)
                     throws IOException,
                            PdfException
Extracts specified pages from a specified document and then appends them to this document.

Parameters:
d - document from which pages need to be appended
pageRange - pages that need to be appended
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
See Also:
PdfFormFieldRenameHandler, PdfStdDocument.setOnRenameField(PdfFormFieldRenameHandler)

appendPagesFrom

public void appendPagesFrom(String path,
                            String pageRange)
                     throws IOException,
                            PdfException
Extracts specified pages from a document (specified by its pathname) and then appends them to this document.

Parameters:
path - document from which pages need to be appended
pageRange - pages that need to be appended
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
See Also:
PdfFormFieldRenameHandler, PdfStdDocument.setOnRenameField(PdfFormFieldRenameHandler)
Sample Code
See example.

insertPagesFrom

public void insertPagesFrom(com.gnostice.pdfone.PdfStdDocument d,
                            String pageRange,
                            int insertAfterPage)
                     throws IOException,
                            PdfException
Insert specified pages from a specified document at specified page position in this document.

Parameters:
d - document from which pages need to be inserted
pageRange - pages that need to be inserted from the document
insertAfterPage - page position in this document where pages from the other document needs to be inserted
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
See Also:
PdfFormFieldRenameHandler, PdfStdDocument.setOnRenameField(PdfFormFieldRenameHandler)

insertPagesFrom

public void insertPagesFrom(String path,
                            String pageRange,
                            int insertAfterPage)
                     throws IOException,
                            PdfException
Insert specified pages from a document (specified by its pathname) at specified page position in this document.

Parameters:
path - pathname of the document from which pages need to be inserted
pageRange - pages that need to be inserted from the document
insertAfterPage - page position in this document where pages from the other document needs to be inserted
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
See Also:
PdfFormFieldRenameHandler, PdfStdDocument.setOnRenameField(PdfFormFieldRenameHandler)

merge

public void merge(List docList)
           throws IOException,
                  PdfException
Merges this document with documents in specified list. The list can be made up of PdfDocument objects or pathnames of the documents.

Parameters:
docList - list containing documents that need to be merged with this document
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
See Also:
PdfFormFieldRenameHandler, PdfStdDocument.setOnRenameField(PdfFormFieldRenameHandler)

merge

public void merge(List docList,
                  int mergeOptions)
           throws IOException,
                  PdfException
Merges this document with documents in specified list using specified merging options. The list can be made up of PdfDocument objects or pathnames of the documents.

Parameters:
docList - list containing documents that need to be merged with this document
mergeOptions - combination of flags (constants) used for merging documents
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
See Also:
PdfFormFieldRenameHandler, PdfStdDocument.setOnRenameField(PdfFormFieldRenameHandler)

merge

public void merge(PdfDocument d)
           throws IOException,
                  PdfException
Merges this document with another document.

Parameters:
d - document that needs to be merged with this document
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
See Also:
PdfFormFieldRenameHandler, PdfStdDocument.setOnRenameField(PdfFormFieldRenameHandler)

merge

public void merge(PdfDocument d,
                  int mergeOptions)
           throws IOException,
                  PdfException
Merges this document with another document using specified merging options.

Parameters:
d - document that needs to be merged with this document
mergeOptions - combination of flags (constants) used for merging documents
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
See Also:
PdfFormFieldRenameHandler, PdfStdDocument.setOnRenameField(PdfFormFieldRenameHandler)

merge

public void merge(String path)
           throws IOException,
                  PdfException
Merges this document with a document specified by its pathname.

Parameters:
path - pathname of the other document that needs to be merged with this document
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
See Also:
PdfFormFieldRenameHandler, PdfStdDocument.setOnRenameField(PdfFormFieldRenameHandler)
Sample Code
See example.

merge

public void merge(String path,
                  int mergeOptions)
           throws IOException,
                  PdfException
Merges this document with a document (specified by its pathname) using specified merging options.

Parameters:
path - pathname of the other document that needs to be merged with this document
mergeOptions - combination of flags (constants) used for merging documents
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
See Also:
PdfFormFieldRenameHandler, PdfStdDocument.setOnRenameField(PdfFormFieldRenameHandler)

setOnBookmarkMerge

public void setOnBookmarkMerge(PdfBookmarkMergeHandler onBookmarkMerge)
Ensures that the onBookmarkMerge() event handler of specified user-class instance is called when the bookmark tree of another document is merged with that of this document. When another document is merged with this document, bookmarks from the other document are also merged with the bookmark tree of this document. Handle this event to place the bookmarks of the other document under a newly created bookmark.

Parameters:
onBookmarkMerge - user-class instance whose onBookmarkMerge() needs to be called

setOnRenameField

public void setOnRenameField(PdfFormFieldRenameHandler pfrh)
Ensures that the onRenameField() event handler of specified user-class instance is called when a duplicate field is encountered in a document-merge operation. Use the event handler to provide a different name for the duplicate field.

Parameters:
pfrh - user-class instance whose onRenameField() needs to be called

deletePages

public void deletePages(String pageRange)
                 throws PdfException
Deletes pages in specified page range from this PdfDocument.

Parameters:
pageRange - page range from which pages need to be deleted
Throws:
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

extractPagesTo

public void extractPagesTo(String path,
                           String pageRange)
                    throws IOException,
                           PdfException
Extracts pages in specified page range and places them in a file specified by its pathname.

Parameters:
path - pathname of the file to which the pages are to be added
pageRange - page range whose pages are to be extracted
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
See Also:
PdfFormFieldRenameHandler, PdfStdDocument.setOnRenameField(PdfFormFieldRenameHandler)
Sample Code
See example.

extractPagesTo

public void extractPagesTo(String path,
                           String pageRange,
                           String extractAsVersion,
                           boolean openAfterExtraction)
                    throws IOException,
                           PdfException
Extracts pages in specified page range in specified PDF version and places them in a new file specified by its pathname.

Parameters:
path - pathname of the file to which the pages are to be added
pageRange - page range whose pages are to be extracted
extractAsVersion - PDF version in which pages are extracted and saved to the new file
openAfterExtraction - whether the output file is to be opened after it is written to
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
See Also:
PdfFormFieldRenameHandler, PdfStdDocument.setOnRenameField(PdfFormFieldRenameHandler)
Sample Code
See example.

split

public void split(String pageRange)
           throws IOException,
                  PdfException
Extracts all pages in the specified page range to a new document.

Specifying pageRange as "1-10" on a 12-page document will create a new document 1-10.pdf containing all pages from 1 to 10.

The name of the new document can be obtained and changed at run time using the onNeedFileName() event.

Parameters:
pageRange - pages that need to be extracted
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
See Also:
PdfStdDocument.setOnNeedFileName(PdfNeedFileNameHandler)

split

public void split(int pages)
           throws IOException,
                  PdfException
Extract specified number of consecutive pages from the PDF document and place them in new PDF documents.

Calling split(5) on a 12-page document will create three new PDF documents, named 1-5.pdf, 6-10.pdf, and 11-13.pdf. The file 1-5.pdf will contain pages 1 to 5 of the original document. The file 6-10.pdf will contain pages 6 to 10 of the original document. The file 11-12.pdf will contain pages 11 to 12 of the original document.

Names for the new documents can be obtained and changed at run time using the onNeedFileName() event.

Parameters:
pages - number of consecutive pages that need to be extracted for each new document
Throws:
IOException - if an I/O error occurs
PdfException - if an illegal argument is supplied.
See Also:
PdfStdDocument.setOnNeedFileName(PdfNeedFileNameHandler)

setOnNeedFileName

public void setOnNeedFileName(PdfNeedFileNameHandler pnfnh)
Ensures that the onNeedFileName() event handler of specified user-class instance is called when this document is being split and a splinter document is created. Use the event handler to specify a name for the splinter file.

Parameters:
pnfnh - user-class instance whose onNeedFileName() needs to be called
See Also:
PdfStdDocument.split(int), PdfStdDocument.split(String)

addWatermarkImage

public void addWatermarkImage(PdfImage image,
                              int position,
                              boolean applyPageMargins,
                              double angle,
                              boolean underlay,
                              String pageRange)
                       throws IOException,
                              PdfException
Adds PdfImage object as watermark with its exact position determined by position and applyPageMargins.

Constants defined in PdfPage can be used to align the image inside the watermark.

The image is rotated on center of its bounding box by angle degrees in anti-clockwise direction.

Parameters:
image - PdfImage object that needs to be used as the watermark image
position - constant specifying the combination of vertical and horizontal alignment of the image
applyPageMargins - whether page margins need to be considered when positioning the image
angle - (measured in anti-clockwise direction and expressed in degrees) tilt of the image with reference to center of its bounding box
underlay - whether the image needs to be placed underneath other page contents
pageRange - page range on whose pages the image needs to be applied as the watermark
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

addWatermarkImage

public void addWatermarkImage(PdfImage image,
                              int position,
                              double angle,
                              boolean underlay,
                              String pageRange)
                       throws IOException,
                              PdfException
Adds PdfImage object as watermark on pages in specified page range.

Constants defined in PdfPage can be used to align the image inside the watermark.

The image is rotated on center of its bounding box by angle degrees in anti-clockwise direction.

Parameters:
image - PdfImage object that needs to be used as the watermark image
position - constant specifying the combination of vertical and horizontal alignment of the image
angle - (measured in anti-clockwise direction and expressed in degrees) tilt of the image with reference to center of its bounding box
underlay - whether the image needs to be placed underneath other page contents
pageRange - page range on whose pages the image needs to be applied as the watermark
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

addWatermarkImage

public void addWatermarkImage(String path,
                              int position,
                              boolean applyPageMargins,
                              double angle,
                              boolean underlay,
                              String pageRange)
                       throws IOException,
                              PdfException
Adds image, specified by its pathname, as watermark with its exact position determined by position and applyPageMargins on pages in specified page range.

Constants defined in PdfPage can be used to align the image inside the watermark.

The image is rotated on center of its bounding box by angle degrees in anti-clockwise direction.

Parameters:
path - pathname of the watermark image
position - constant specifying the combination of vertical and horizontal alignment of the image
applyPageMargins - whether page margins need to be considered when positioning the image
angle - (measured in anti-clockwise direction and expressed in degrees) tilt of the image with reference to center of its bounding box
underlay - whether the image needs to be placed underneath other page contents
pageRange - page range on whose pages the image needs to be applied as the watermark
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

addWatermarkImage

public void addWatermarkImage(String path,
                              int position,
                              double angle,
                              boolean underlay,
                              String pageRange)
                       throws IOException,
                              PdfException
Adds image, specified by its pathname, as watermark on pages in specified page range.

Constants defined in PdfPage can be used to align the image inside the watermark.

The image is rotated on center of its bounding box by angle degrees in anti-clockwise direction.

Parameters:
path - pathname of the watermark image
position - constant specifying the combination of vertical and horizontal alignment of the image
angle - (measured in anti-clockwise direction and expressed in degrees) tilt of the image with reference to center of its bounding box
underlay - whether the image needs to be placed underneath other page contents
pageRange - page range on whose pages the image needs to be applied as the watermark
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

addWatermarkText

public void addWatermarkText(String text,
                             PdfFont font,
                             int position,
                             boolean applyPageMargins,
                             double angle,
                             boolean underlay,
                             String pageRange)
                      throws IOException,
                             PdfException
Adds specified text as watermark with its exact position determined by position and applyPageMargins on pages in specified page range.

Constants defined in PdfPage can be used to align the text inside the watermark.

The text is rotated on center of its bounding box by angle degrees in anti-clockwise direction.

Parameters:
text - text that needs to be added as the watermark
font - font with which the watermark needs to be written
position - constant specifying the combination of vertical and horizontal alignment of the text
applyPageMargins - whether page margins need to be considered when positioning the text
angle - (measured in anti-clockwise direction and expressed in degrees) tilt of the text with reference to center of its bounding box
underlay - whether the text needs to be placed underneath other page contents
pageRange - page range on whose pages the text needs to be applied as the watermark
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

addWatermarkText

public void addWatermarkText(String text,
                             PdfFont font,
                             int position,
                             double angle,
                             boolean underlay,
                             String pageRange)
                      throws IOException,
                             PdfException
Adds specified text as watermark on pages in specified page range.

Constants defined in PdfPage can be used to align the text inside the watermark.

The text is rotated on center of its bounding box by angle degrees in anti-clockwise direction.

Parameters:
text - text to be displayed as watermark
font - font with which the watermark needs to be written
position - constant specifying the combination of vertical and horizontal alignment of the text
angle - (measured in anti-clockwise direction and expressed in degrees) tilt of the text with reference to center of its bounding box
underlay - whether the text needs to be placed underneath other page contents
pageRange - page range on whose pages the text needs to be applied as the watermark
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

addWatermarkText

public void addWatermarkText(String text,
                             PdfFont font,
                             PdfRect rect,
                             int alignment,
                             int firstLinePosition,
                             int position,
                             double angle,
                             boolean underlay,
                             String pageRange)
                      throws IOException,
                             PdfException
Adds specified text as a watermark to a specified rectangular area on a specified pages with specified font, alignment, first-line position, position, rotation, and underlay settings.

Parameters:
text - text that needs to be used as watermark
font - font with which the watermark text needs to be rendered
rect - rectangular area inside which the watermark needs to be rendered
alignment - constant specifying text alignment
firstLinePosition - starting position of the first line of the watermark text
position - constant specifying the combination of vertical and horizontal alignment of the text
angle - (measured in anti-clockwise direction and expressed in degrees) tilt of the text with reference to center of its bounding box
underlay - whether the text needs to be placed underneath other page contents
pageRange - pages where the watermark need to be added
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.

addBookmark

public PdfBookmark addBookmark(int namedAction,
                               String title,
                               PdfBookmark parent)
                        throws IOException,
                               PdfException
Returns a new child bookmark (added under parent) with specified title, and sets the bookmark to perform specified named action.

Parameters:
namedAction - action to be be performed when bookmark is selected
title - text that needs to be used to display the bookmark
parent - bookmark under which the new bookmark is to be created
Returns:
new bookmark created under parent
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Sample Code
See example. *

addBookmark

public PdfBookmark addBookmark(String title,
                               PdfBookmark parent,
                               int pageNo)
                        throws PdfException,
                               IOException
Returns a new child bookmark (added under parent) with specified title, and sets the bookmark to lead to specified page.

Parameters:
title - text that needs to be used to display the bookmark
parent - bookmark under which the new bookmark is to be created
pageNo - number of the page that is to be displayed when bookmark is selected
Returns:
a new bookmark created under parent
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

addBookmark

public PdfBookmark addBookmark(String title,
                               PdfBookmark parent,
                               int pageNo,
                               double left,
                               double top,
                               double zoom)
                        throws PdfException,
                               IOException
Returns a new child bookmark (added under parent) with specified title, and sets the bookmark to lead to specified location on specified page with specified zoom.

Parameters:
title - text that needs to be used to display the bookmark
parent - bookmark under which the new bookmark is to be created
pageNo - number of the page that is to be displayed when bookmark is selected
left - offset of the position from (0, top) (expressed in points)
top - offset of the position from (left, 0) (expressed in points)
zoom - zoom factor to be applied when displaying the page
Returns:
a new bookmark created under parent
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

addBookmark

public PdfBookmark addBookmark(String title,
                               PdfBookmark parent,
                               int pageNo,
                               double x,
                               double y,
                               double width,
                               double height)
                        throws PdfException,
                               IOException
Returns a new child bookmark (added under parent), and sets the bookmark's destination to a rectangular area with specified top-left corner (x, y), width and height.

Parameters:
title - text that needs to be used to display the bookmark
parent - bookmark under which the new bookmark is to be created
pageNo - number of the page that needs to be displayed when bookmark is selected by the user
x - x-coordinate of the top-left corner of the rectangular area
y - y-coordinate of the top-left corner of the rectangular area
width - width of the rectangular area
height - height of the rectangular area
Returns:
a new bookmark created under parent
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Sample Code
See example.

addBookmark

public PdfBookmark addBookmark(String title,
                               PdfBookmark parent,
                               int pageNo,
                               double pos,
                               int fit)
                        throws PdfException,
                               IOException
Returns a new child bookmark (added under parent), and sets the bookmark's destination specified by pageNo, pos and fit.
fit pos Page Display
PdfBookmark.FITH vertical coordinate of destination
  • pos is positioned on the top edge of the window.
  • Page is zoomed to tightly fit the entire width of the page inside the window.
PdfBookmark.FITBH vertical coordinate of destination
  • pos is positioned on top edge of the window.
  • Page is zoomed to tightly fit the entire width of its bounding box inside the window.
PdfBookmark.FITBV horizontal coordinate of destination
  • pos is positioned on the left edge of the window.
  • Page is zoomed to tightly fit the entire height of its bounding box inside the window.
PdfBookmark.FITV horizontal coordinate of destination
  • pos is positioned on the left edge of the window.
  • Page is zoomed to tightly fit the entire height of the page insidethe window.

Parameters:
title - text that needs to be used to display the bookmark
parent - bookmark under which the new bookmark is to be created
pageNo - number of the page that is to be displayed when bookmark is selected
pos - horizontal or vertical coordinate of the bookmark's destination
fit - constant determining how page is displayed inside window
Returns:
a new bookmark created under parent
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

addBookmark

public PdfBookmark addBookmark(String title,
                               PdfBookmark parent,
                               int pageNo,
                               int fit)
                        throws PdfException,
                               IOException
Returns a new child bookmark (added under parent) with specified title, and sets the bookmark's destination specified by pageNo and fit.

Parameters:
title - text that needs to be used to display the bookmark
parent - bookmark under which the new bookmark is to be created
pageNo - number of the page that is to be displayed when bookmark is selected
fit - constant determining how page is displayed inside window (Always is PdfBookmark.FITB)
Returns:
a new bookmark created under parent
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

addBookmark

public PdfBookmark addBookmark(String title,
                               PdfBookmark parent,
                               int pageNo,
                               PdfRect rect)
                        throws PdfException,
                               IOException
Returns a new child bookmark (added under parent) with specified title and sets the bookmark to lead to specified rectanglular area on specified page.

Parameters:
title - text that needs to be used to display the bookmark
parent - bookmark under which the new bookmark is to be created
pageNo - number of the page that is to be displayed when bookmark is selected
rect - rectangle on the specified page
Returns:
a new bookmark created under parent
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

addBookmark

public PdfBookmark addBookmark(String title,
                               PdfBookmark parent,
                               int pageNo,
                               Rectangle rect)
                        throws PdfException,
                               IOException
Returns a new child bookmark (added under parent) with specified title, and sets the bookmark to lead to specified rectangular area on specified page.

Parameters:
title - text that needs to be used to display the bookmark
parent - bookmark under which the new bookmark is to be created
pageNo - number of the page that is to be displayed when bookmark is selected
rect - rectangular area on the specified page
Returns:
a new bookmark created under parent
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

addBookmark

public PdfBookmark addBookmark(String title,
                               PdfBookmark parent,
                               String applicationToLaunch,
                               boolean print)
                        throws PdfException,
                               IOException
Adds a new child bookmark (under parent), and sets it to launch a specified application or print a specified file. If print is true, then the file applicationToLaunch will be printed by the viewer using the file type's default application. If print is false, then file applicationToLaunch will be considered as an aplication and launched by the viewer using the Operating Sytem's (OS') default shell program.

Parameters:
title - text that needs to be used to display the bookmark
parent - bookmark below which the new bookmark needs to be created
applicationToLaunch - application that needs to be launched (if print were false) or the file that needs to be printed (if print was true)
print - whether the file applicationToLaunch needs to be printed
Returns:
a new bookmark created under parent
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Sample Code
See example.

addBookmark

public PdfBookmark addBookmark(String title,
                               PdfBookmark parent,
                               String javascriptOrURI,
                               int actionType)
                        throws PdfException,
                               IOException
Adds a new child bookmark (under parent) and sets it execute a Javascript script or resolve a URI (Uniform Resource Identifier).

Parameters:
title - text that needs to be used to display the bookmark
parent - bookmark below which the new bookmark needs to be created
javascriptOrURI - Javascript script that needs to be executed or the URI that needs to be resolved
actionType - constant identifying the action as a Javascript action (PdfAction.JAVASCRIPT) or a URI action (PdfAction.URI)
Returns:
a new bookmark created under parent
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Sample Code
See example.

addBookmark

public PdfBookmark addBookmark(String title,
                               PdfBookmark parent,
                               String pdfFileName,
                               int pageNo,
                               boolean newWindow)
                        throws PdfException,
                               IOException
Returns a new child bookmark (added under parent), and sets it to open a specified page on a specified PDF document in the same window or a new window of the viewer.

Parameters:
title - text that needs to be used to display the bookmark
parent - bookmark below which the new bookmark needs to be created
pdfFileName - pathname of the PDF document that needs to be opened
pageNo - number of the page in the PDF document
newWindow - whether to open the PDF document in a new window. If set to false, the document is opened in the same window.
Returns:
a new bookmark created under parent
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Sample Code
See example.

getBookmarkRoot

public PdfBookmark getBookmarkRoot()
                            throws IOException,
                                   PdfException
Returns a PdfBookmark object that points to the root of the bookmark tree of this PdfDocument. Should be used only if the PdfDocument was created with a PdfWriter object.

The root is at the top of the hierarchy that contains bookmarks displayed in the document outline. The PdfBookmark.getFirstChild() method can be used on the PdfBookmark returned by getBookmarkRoot() to navigate to the first bookmark in the document outline.

Returns:
PdfBookmark object that points to the root of the bookmark tree
Throws:
PdfException - An illegal argument was supplied
IOException
Since:
1.0
See Also:
PdfStdDocument.getFirstBookmark(), PdfStdDocument.removeBookmarkRoot()
Sample Code
See example.

removeBookmarkRoot

public void removeBookmarkRoot()
Removes all bookmarks existing in the document. It also sets the document to be displayed in a viewer application without the bookmark panel.

See Also:
PdfStdDocument.getBookmarkRoot(), PdfStdDocument.getFirstBookmark()

getFirstBookmark

public PdfBookmark getFirstBookmark()
                             throws IOException,
                                    PdfException
Returns first bookmark in this PdfDocument's document outline. Should be used only if the PdfDocument was created with a PdfReader object.

Returns:
a PdfBookmark object of the first bookmark in the document outline
Throws:
PdfException - if an illegal argument is supplied.
IOException
Since:
1.0
See Also:
PdfStdDocument.getBookmarkRoot(), PdfStdDocument.removeBookmarkRoot()
Sample Code
See example.

add

public void add(PdfPage p)
         throws PdfException
Adds specified PdfPage to this PdfDocument.

It is not recommended that a PdfPage object is added to the same document or to multiple documents more than once. If at all necessary, it is better to clone the PdfPage object as many times.

Parameters:
p - PdfPage to be added
Throws:
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

add

public void add(PdfPage p,
                boolean setAsCurrentPage)
         throws PdfException
Adds specified PdfPage to this PdfDocument and, if setAsCurrentPage is true, sets the PdfPage as the PdfDocument's current page.

By default, the first page that is added to a PdfDocument is the default current page. If some content has been written directly to a PdfDocument that is without first adding a page, then a default page is automatically added to it and becomes its current page.

Parameters:
p - PdfPage to be added
setAsCurrentPage - whether the PdfPage should be set as the current page
Throws:
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

addFooterImage

public void addFooterImage(PdfImage img,
                           int position,
                           boolean underlay,
                           String pageRange)
                    throws IOException,
                           PdfException
Adds PdfImage object to footer of pages in specified page range.

Constants defined in PdfPage can be used to align the image inside the footer.

Parameters:
img - PdfImage object to be used in the footer
position - constant specifying combination of vertical and horizontal alignment of the image within the footer
underlay - whether the image needs to be placed underneath other page elements
pageRange - page range on whose pages the image is to be added
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

addFooterImage

public void addFooterImage(String path,
                           int position,
                           boolean underlay,
                           String pageRange)
                    throws IOException,
                           PdfException
Adds image, specified by its pathname, to footer of pages in specified page range.

Constants defined in PdfPage can be used to align the image inside the footer.

Parameters:
path - pathname of the image
position - constant specifying combination of vertical and horizontal alignment of the image within the footer
underlay - whether the image needs to be placed underneath other content in the footer
pageRange - page range on whose pages the image is to be added
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

addFooterText

public void addFooterText(String text,
                          PdfFont font,
                          int position,
                          boolean underlay,
                          String pageRange)
                   throws IOException,
                          PdfException
Adds specified text to footer of pages in specified page range.

Constants defined in PdfPage can be used to align the text inside the footer.

Parameters:
text - text to be added to the footer
font - font with which the text next needs to be written
position - constant specifying the combination of vertical and horizontal alignment of the text within the footer
underlay - whether the text needs to be placed underneath other content in the footer
pageRange - page range on whose pages the text is to be added
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

addFooterText

public void addFooterText(String text,
                          PdfFont font,
                          PdfRect rect,
                          int alignment,
                          int firstLinePosition,
                          int position,
                          boolean underlay,
                          String pageRange)
                   throws IOException,
                          PdfException
Adds a text footer to a specfied page range with specified font, first-line position, vertical/horizontal alignment, and underlay settings.

Parameters:
text - text that needs to be added as the footer
font - font with which the text next needs to be written
rect - rectangular area where the footer needs to be rendered
alignment - constant specifying text alignment
firstLinePosition - starting position of the first line of the header text
position - constant specifying the combination of vertical and horizontal alignment of the text
underlay - whether the footer needs to be placed underneath other page elements
pageRange - pages on which the header needs to be rendered
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.

addHeaderImage

public void addHeaderImage(PdfImage img,
                           int position,
                           boolean underlay,
                           String pageRange)
                    throws IOException,
                           PdfException
Adds a PdfImage object to header of pages in specified page range.

Constants defined in PdfPage can be used to align the image inside the header.

Parameters:
img - PdfImage object that needs to be added to the header
position - constant specifying the combination of vertical and horizontal alignment of the image within the header
underlay - whether the image needs to be placed underneath other content in the header
pageRange - page range on whose pages the image is to be added
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

addHeaderImage

public void addHeaderImage(String path,
                           int position,
                           boolean underlay,
                           String pageRange)
                    throws IOException,
                           PdfException
Adds image, specified by its pathname, to footer of pages in specified page range.

Constants defined in PdfPage can be used to align the image inside the header.

Parameters:
path - pathname of the image
position - constant specifying combination of vertical and horizontal alignment of the image within the header
underlay - whether the image needs to be placed underneath other content in the header
pageRange - page range on whose pages the image is to be added
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

addHeaderText

public void addHeaderText(String text,
                          PdfFont font,
                          int position,
                          boolean underlay,
                          String pageRange)
                   throws IOException,
                          PdfException
Adds specified text to header of pages in specified page range.

Constants defined in PdfPage can be used to align the text inside the watermark.

Parameters:
text - text to be added to header
font - font with which the text next needs to be written
position - combination of vertical and horizontal alignment
underlay - whether the text needs to be placed underneath other content in the header
pageRange - page range on whose pages the text is to be added
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

addHeaderText

public void addHeaderText(String text,
                          PdfFont font,
                          PdfRect rect,
                          int alignment,
                          int firstLinePosition,
                          int position,
                          boolean underlay,
                          String pageRange)
                   throws IOException,
                          PdfException
Adds specified text as a header on a specified rectangular area in specified pages with specified font, alignment, first-line position, vertical/horizontal position, and underlay settings.

Parameters:
text - text that needs to be used as a header
font - font with which the header text is rendered
rect - rectangular area inside which the header needs to be rendered
alignment - constant specifying text alignment
firstLinePosition - starting position of the first line of the header text
position - constant specifying the combination of vertical and horizontal alignment of the text
underlay - whether the header needs to be placed underneath other page elements
pageRange - pages on which the header needs to be rendered
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.

drawArc

public void drawArc(PdfRect rect,
                    double startAngle,
                    double arcAngle)
             throws IOException,
                    PdfException
Draws an arc on the current page of this PdfDocument. Rectangle rect represents bounding box of an imaginary circle that completes the arc. The arc begins at startAngle degrees and spans for arcAngle degrees. startAngle is measured in anti-clockwise direction.

Parameters:
rect - bounding box of the imaginary circle that completes the arc
startAngle - (measured in anti-clockwise direction and expressed in degrees) angle from which the arc needs to begin
arcAngle - (expressed in degrees) angle for which the arc needs to span
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawArc

public void drawArc(PdfRect rect,
                    double startAngle,
                    double arcAngle,
                    String pageRange)
             throws IOException,
                    PdfException
Draws an arc on pages in specified page range. Rectangle rect represents bounding box of an imaginary circle that completes the arc. The arc begins at startAngle degrees and spans for arcAngle degrees. startAngle is measured in anti-clockwise direction.

Parameters:
rect - bounding box of the imaginary circle that completes the arc
startAngle - (measured in anti-clockwise direction and expressed in degrees) angle from which the arc needs to begin
arcAngle - (expressed in degrees) angle for which the arc needs to span
pageRange - page page range on whose pages the arc needs to be drawn
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawBezierCurve

public void drawBezierCurve(double startX,
                            double startY,
                            double ctrlX,
                            double ctrlY,
                            double endX,
                            double endY,
                            boolean isFill,
                            boolean isStroke)
                     throws IOException,
                            PdfException
Draws a Bézier curve with a single control point on current page of this PdfDocument. The curves starts at (startX, startY) and ends at (endX, endY with its control point being at (ctrlX, ctrlY).

Parameters:
startX - x-coordinate of starting point of the curve
startY - y-coordinate of starting point of the curve
ctrlX - x-coordinate of control point of the curve
ctrlY - y-coordinate of control point of the curve
endX - x-coordinate of end point of the curve
endY - y-coordinate of end point of the curve
isFill - whether the curve needs to be filled
isStroke - whether the curve needs to be stroked
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawBezierCurve

public void drawBezierCurve(double startX,
                            double startY,
                            double ctrlX,
                            double ctrlY,
                            double endX,
                            double endY,
                            boolean isFill,
                            boolean isStroke,
                            String pageRange)
                     throws IOException,
                            PdfException
Draws a Bézier curve with a single control point on pages in specified page range in this PdfDocument. The curves starts at (startX, startY) and ends at (endX, endY with its control point being at (ctrlX, ctrlY).

Parameters:
startX - x-coordinate of starting point of the curve
startY - y-coordinate of starting point of the curve
ctrlX - x-coordinate of control point of the curve
ctrlY - y-coordinate of control point of the curve
endX - x-coordinate of end point of the curve
endY - y-coordinate of end point of the Bézier curve
isFill - whether the curve needs to be filled
isStroke - whether the curve needs to be stroked
pageRange - page range on whose pages the curve needs to be drawn
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawBezierCurve

public void drawBezierCurve(double startX,
                            double startY,
                            double ctrlX1,
                            double ctrlY1,
                            double ctrlX2,
                            double ctrlY2,
                            double endX,
                            double endY,
                            boolean isFill,
                            boolean isStroke)
                     throws IOException,
                            PdfException
Draws a Bézier curve with two control points on current page of this PdfDocument. The curve starts at (startX, startY) and ends at (endX, endY. Its first control point is at (ctrlX1, ctrlY1). Its second control point is at (ctrlX2, ctrlY2).

Parameters:
startX - x-coordinate of starting point of the curve
startY - y-coordinate of starting point of the curve
ctrlX1 - x-coordinate of first control point of the curve
ctrlY1 - y-coordinate of first control point of the curve
ctrlX2 - x-coordinate of second control point of the curve
ctrlY2 - y-coordinate of second control point of the curve
endX - x-coordinate of end point of the curve
endY - y-coordinate of end point of the curve
isFill - whether the curve needs to be filled
isStroke - whether the curve needs to be stroked
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawBezierCurve

public void drawBezierCurve(double startX,
                            double startY,
                            double ctrlX1,
                            double ctrlY1,
                            double ctrlX2,
                            double ctrlY2,
                            double endX,
                            double endY,
                            boolean isFill,
                            boolean isStroke,
                            String pageRange)
                     throws IOException,
                            PdfException
Draws a Bézier curve with two control points on pages in specified page range on this PdfDocument. The curve starts at (startX, startY) and ends at (endX, endY. Its first control point is at (ctrlX1, ctrlY1). Its second control point is at (ctrlX2, ctrlY2).

Parameters:
startX - x-coordinate of starting point of the curve
startY - y-coordinate of starting point of the curve
ctrlX1 - x-coordinate of first control point of the curve
ctrlY1 - y-coordinate of first control point of the curve
ctrlX2 - x-coordinate of second control point of the curve
ctrlY2 - y-coordinate of second control point of the curve
endX - x-coordinate of end point of the curve
endY - y-coordinate of end point of the curve
isFill - whether the curve needs to be filled
isStroke - whether the curve needs to be stroked
pageRange - page range on whose pages the curve needs to be drawn
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawCircle

public void drawCircle(double x,
                       double y,
                       double radius,
                       boolean isFill,
                       boolean isStroke)
                throws IOException,
                       PdfException
Draws a circle with specified radius on this PdfDocument's current page. The circle's center is positioned at (x, y).

Parameters:
x - x-coordinate of the center of the circle
y - y-coordinate of the center of the circle
radius - radius of the circle
isFill - whether the circle needs to be filled
isStroke - whether the circle needs to be stroked
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawCircle

public void drawCircle(double x,
                       double y,
                       double radius,
                       boolean isFill,
                       boolean isStroke,
                       String pageRange)
                throws IOException,
                       PdfException
Draws a circle with specified radius on pages in specified page range on this PdfDocument. The circle's center is positioned at (x, y).

Parameters:
x - x-coordinate of the center of the circle
y - y-coordinate of the center of the circle
radius - radius of the circle
isFill - whether the circle needs to be filled
isStroke - whether the circle needs to be stroked
pageRange - page range on whose pages the circle will be drawn
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawEllipse

public void drawEllipse(double x1,
                        double y1,
                        double x2,
                        double y2,
                        boolean isFill,
                        boolean isStroke)
                 throws IOException,
                        PdfException
Draws an ellipse on this PdfDocument's current page. Top-left corner of ellipse's bounding box is specified by (x1, y1). Bottom-right corner of ellipse's bounding box is specified by (x2, y2).

Parameters:
x1 - x-coordinate of the top-left corner of the ellipse's bounding box
y1 - y-coordinate of the top-left corner of the ellipse's bounding box
x2 - x-coordinate of the bottom-right corner of the ellipse's bounding box
y2 - y-coordinate of the bottom-right corner of the ellipse's bounding box
isFill - whether the ellipse needs to be filled
isStroke - whether the ellipse needs to be stroked
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawEllipse

public void drawEllipse(double x1,
                        double y1,
                        double x2,
                        double y2,
                        boolean isFill,
                        boolean isStroke,
                        String pageRange)
                 throws IOException,
                        PdfException
Draws an ellipse on pages in specified page range on this PdfDocument's current page. Top-left corner of ellipse's bounding box is specified by (x1, y1). Bottom-right corner of ellipse's bounding box is specified by (x2, y2).

Parameters:
x1 - x-coordinate of the top-left corner of the ellipse's bounding box
y1 - y-coordinate of the top-left corner of the ellipse's bounding box
x2 - x-coordinate of the bottom-right corner of the ellipse's bounding box
y2 - y-coordinate of the bottom-right corner of the ellipse's bounding box
isFill - whether the ellipse needs to be filled
isStroke - whether the ellipse needs to be stroked
pageRange - page range on whose pages the ellipse needs to be drawn
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawImage

public void drawImage(PdfImage img,
                      double x,
                      double y)
               throws IOException,
                      PdfException
Draws specified image at position (x, y) on this PdfDocument's current page.

Parameters:
img - image that needs to be drawn
x - x-coordinate of the position where the image needs to be drawn
y - y-coordinate of the position where the image needs to be drawn
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawImage

public void drawImage(PdfImage img,
                      double x,
                      double y,
                      boolean scaleToFit,
                      boolean stretch)
               throws IOException,
                      PdfException
Renders specified image at position (x, y) with specified stretching and aspect ratio settings on the document's current page. The scaleToFit and stretch arguments are useful when the full size of the image cannot be fit within the page at the specified location. If scaleToFit and stretch are false, then the part of the image that cannot be displayed within the page will be clipped out. If scaleToFit is true and stretch is false, then width or height (whichever is lower) of the image will be scaled to meet the right or bottom edge of the page. If scaleToFit is true and stretch is true, then both width and height of the image will be scaled to meet the image meet the the right and bottom edges of the page. stretch will be considered only if scaleToFit is true.

Parameters:
img - image that needs to be drawn
x - x-coordinate of the position where the image needs to be rendered
y - y-coordinate of the position where the image needs to be rendered
scaleToFit - whether image needs to be scaled (horizontally, vertically, or both) to fit within the the area available in the page
stretch - whether both width and height of the image should be stretched to fit the area available in the page
Throws:
IOException - if I/O error occurs.
PdfException - if an illegal argument is supplied.

drawImage

public void drawImage(PdfImage img,
                      double x,
                      double y,
                      boolean scaleToFit,
                      boolean stretch,
                      String pageRange)
               throws IOException,
                      PdfException
Renders specified image at position (x, y) with specified stretching and aspect ratio settings on specified pages. The scaleToFit and stretch arguments are useful when the full size of the image cannot be fit within the page at the specified location. If scaleToFit and stretch are false, then the part of the image that cannot be displayed within the page will be clipped out. If scaleToFit is true and stretch is false, then width or height (whichever is lower) of the image will be scaled to meet the right or bottom edge of the page. If scaleToFit is true and stretch is true, then both width and height of the image will be scaled to meet the image meet the the right and bottom edges of the page. stretch will be considered only if scaleToFit is true.

Parameters:
img - image that needs to be drawn
x - x-coordinate of the position where the image needs to be rendered
y - y-coordinate of the position where the image needs to be rendered
scaleToFit - whether image needs to be scaled (horizontally, vertically, or both) to fit within the the area available in the page
stretch - whether both width and height of the image should be stretched to fit the area available in the page
pageRange - pages where the image needs to rendered
Throws:
IOException - if I/O error occurs.
PdfException - if an illegal argument is supplied.

drawImage

public void drawImage(PdfImage img,
                      double x,
                      double y,
                      double rotation)
               throws IOException,
                      PdfException
Draws specified image rotated by rotation degrees at position (x, y) on this PdfDocument's current page.

The image is rotated on center of its bounding box by angle degrees in anti-clockwise direction.

Parameters:
img - image that needs to be drawn
x - x-coordinate of the position where the image needs to be drawn
y - y-coordinate of the position where the image needs to be drawn
rotation - (measured in anti-clockwise direction and expressed in degrees) tilt of the image with reference to center of its bounding box
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawImage

public void drawImage(PdfImage img,
                      double x,
                      double y,
                      double width,
                      double height)
               throws IOException,
                      PdfException
Draws specified image at position (x, y) with specified height and width on this PdfDocument's current page.

Parameters:
img - image that needs to be drawn
x - x-coordinate of the position where the image needs to be drawn
y - y-coordinate of the position where the image needs to be drawn
width - width of the image
height - height of the image
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawImage

public void drawImage(PdfImage img,
                      double x,
                      double y,
                      double width,
                      double height,
                      double rotation)
               throws IOException,
                      PdfException
Draws specified image rotated by rotation degrees at position (x, y) with specified height and width on this PdfDocument's current page.

The image is rotated on center of its bounding box by angle degrees in anti-clockwise direction.

Parameters:
img - image that needs to be drawn
x - x-coordinate of the position where the image needs to be drawn
y - y-coordinate of the position where the image needs to be drawn
width - width of the image
height - height of the image
rotation - (measured in anti-clockwise direction and expressed in degrees) tilt of the image with reference to center of its bounding box
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawImage

public void drawImage(PdfImage img,
                      double x,
                      double y,
                      double width,
                      double height,
                      double rotation,
                      String pageRange)
               throws IOException,
                      PdfException
Draws specified image rotated by rotation degrees at position (x, y) with specified height and width on pages in specified page range.

The image is rotated on center of its bounding box by angle degrees in anti-clockwise direction.

Parameters:
img - image that needs to be drawn
x - x-coordinate of the position where the image needs to be drawn
y - y-coordinate of the position where the image needs to be drawn
width - width of the image
height - height of the image
rotation - (measured in anti-clockwise direction and expressed in degrees) tilt of the image with reference to center of its bounding box
pageRange - page range on whose pages the image needs to be drawn
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawImage

public void drawImage(PdfImage img,
                      double x,
                      double y,
                      double width,
                      double height,
                      String pageRange)
               throws IOException,
                      PdfException
Draws specified image at position (x, y) with specified height and width on pages in specified page range.

Parameters:
img - image that needs to be drawn
x - x-coordinate of the position where the image needs to be drawn
y - y-coordinate of the position where the image needs to be drawn
width - width of the image
height - height of the image
pageRange - page range on whose pages the image needs to be drawn
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawImage

public void drawImage(PdfImage img,
                      double x,
                      double y,
                      double rotation,
                      String pageRange)
               throws IOException,
                      PdfException
Draws specified image rotated by rotation degrees at position (x, y) on pages in specified page range.

The image is rotated on center of its bounding box by angle degrees in anti-clockwise direction.

Parameters:
img - image that needs to be drawn
x - x-coordinate of the position where the image needs to be drawn
y - y-coordinate of the position where the image needs to be drawn
rotation - (measured in anti-clockwise direction and expressed in degrees) tilt of the image with reference to center of its bounding box
pageRange - page range on whose pages the image needs to be drawn
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawImage

public void drawImage(PdfImage img,
                      double x,
                      double y,
                      String pageRange)
               throws IOException,
                      PdfException
Draws specified image at position (x, y) on pages in specified page range.

Parameters:
img - image that needs to be drawn
x - x-coordinate of the position where the image needs to be drawn
y - y-coordinate of the position where the image needs to be drawn
pageRange - page range on whose pages the image needs to be drawn
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawImage

public void drawImage(PdfImage img,
                      PdfPoint pt)
               throws IOException,
                      PdfException
Draws specified image at specified point on this PdfDocument's current page.

Parameters:
img - image that needs to be drawn
pt - point where the image needs to be drawn
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawImage

public void drawImage(PdfImage img,
                      PdfPoint pt,
                      double rotation)
               throws IOException,
                      PdfException
Draws specified image rotated by rotation degrees at specified point on this PdfDocument's current page.

The image is rotated on center of its bounding box by angle degrees in anti-clockwise direction.

Parameters:
img - image that needs to be drawn
pt - point where the image needs to be drawn
rotation - (measured in anti-clockwise direction and expressed in degrees) tilt of the image with reference to center of its bounding box
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawImage

public void drawImage(PdfImage img,
                      PdfPoint pt,
                      double width,
                      double height)
               throws IOException,
                      PdfException
Draws specified image at specified point with specified width and height on this PdfDocument's current page.

Parameters:
img - image that needs to be drawn
pt - point where the image needs to be drawn
width - width of the image
height - height of the image
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawImage

public void drawImage(PdfImage img,
                      PdfPoint pt,
                      double width,
                      double height,
                      double rotation)
               throws IOException,
                      PdfException
Draws specified image rotated by rotation degrees at specified point on this PdfDocument's current page.

The image is rotated on center of its bounding box by angle degrees in anti-clockwise direction.

Parameters:
img - image that needs to be drawn
pt - point where the image needs to be drawn
width - width of the image
height - height of the image
rotation - (measured in anti-clockwise direction and expressed in degrees) tilt of the image with reference to center of its bounding box
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawImage

public void drawImage(PdfImage img,
                      PdfPoint pt,
                      double width,
                      double height,
                      double rotation,
                      String pageRange)
               throws IOException,
                      PdfException
Draws specified image rotated by rotation degrees at specified point with specified width and height on pages in the specified page range.

The image is rotated on center of its bounding box by angle degrees in anti-clockwise direction.

Parameters:
img - image that needs to be drawn
pt - point where the image needs to be drawn
width - width of the image
height - height of the image
rotation - (measured in anti-clockwise direction and expressed in degrees) tilt of the image with reference to center of its bounding box
pageRange - page range on whose pages the image needs to be drawn
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawImage

public void drawImage(PdfImage img,
                      PdfPoint pt,
                      double width,
                      double height,
                      String pageRange)
               throws IOException,
                      PdfException
Draws specified image at specified point with specified width and height on pages in the specified page range.

Parameters:
img - image that needs to be drawn
pt - point where the image needs to be drawn
width - width of the image
height - width of the image
pageRange - page range on whose pages the image needs to be drawn
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawImage

public void drawImage(PdfImage img,
                      PdfPoint pt,
                      double rotation,
                      String pageRange)
               throws IOException,
                      PdfException
Draws specified image rotated by rotation degrees at specified point on pages in the specified page range.

The image is rotated on center of its bounding box by angle degrees in anti-clockwise direction.

Parameters:
img - image that needs to be drawn
pt - point where the image needs to be drawn
rotation - (measured in anti-clockwise direction and expressed in degrees) tilt of the image with reference to center of its bounding box
pageRange - page range on whose pages the image needs to be drawn
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawImage

public void drawImage(PdfImage img,
                      PdfPoint pt,
                      String pageRange)
               throws IOException,
                      PdfException
Draws specified image at specified point on pages in specified page range.

Parameters:
img - image that needs to be drawn
pt - point where the image needs to be drawn
pageRange - page range on whose pages the image needs to be drawn
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawImage

public void drawImage(PdfImage img,
                      PdfRect rect)
               throws IOException,
                      PdfException
Draws specified image inside specified rectangle on this PdfDocument's current page.

Parameters:
img - image that needs to be drawn
rect - PdfRectangle object inside which the image needs to be drawn
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawImage

public void drawImage(PdfImage img,
                      PdfRect rect,
                      double rotation)
               throws IOException,
                      PdfException
Draws specified image rotated by rotation degrees inside specified rectangle on this PdfDocument's current page.

The image is rotated on center of its bounding box by angle degrees in anti-clockwise direction.

Parameters:
img - image that needs to be drawn
rect - rectangle on which the image needs to be drawn
rotation - (measured in anti-clockwise direction and expressed in degrees) tilt of the image with reference to center of its bounding box
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawImage

public void drawImage(PdfImage img,
                      PdfRect rect,
                      double rotation,
                      String pageRange)
               throws IOException,
                      PdfException
Draws specified image rotated by rotation degrees inside specified rectangle on pages in specified range.

The image is rotated on center of its bounding box by angle degrees in anti-clockwise direction.

Parameters:
img - image that needs to be drawn
rect - PdfRect object of the rectangle inside which the image is to be drawn
rotation - (measured in anti-clockwise direction and expressed in degrees) tilt of the image with reference to center of its bounding box
pageRange - page range on whose pages the image is to be drawn
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawImage

public void drawImage(PdfImage img,
                      PdfRect rect,
                      String pageRange)
               throws IOException,
                      PdfException
Draws specified image inside specified rectangle on pages in specified page range.

Parameters:
img - image that needs to be drawn
rect - rectangle on which the image needs to be drawn
pageRange - page range on whose pages the image needs to be drawn
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawImage

public void drawImage(String path,
                      double x,
                      double y)
               throws IOException,
                      PdfException
Draws image specified by its pathname at position (x, y) on this PdfDocument's current page.

Parameters:
path - pathname of the image file
x - x-coordinate of the position where the image needs to be drawn
y - y-coordinate of the position where the image needs to be drawn
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawImage

public void drawImage(String path,
                      double x,
                      double y,
                      double rotation)
               throws IOException,
                      PdfException
Draws image specified by its pathname rotated at rotation degrees at position (x, y) on this PdfDocument's current page.

The image is rotated on center of its bounding box by angle degrees in anti-clockwise direction.

Parameters:
path - pathname of the image file
x - x-coordinate of the position where the image needs to be drawn
y - y-coordinate of the position where the image needs to be drawn
rotation - (measured in anti-clockwise direction and expressed in degrees) tilt of the image with reference to center of its bounding box
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawImage

public void drawImage(String path,
                      double x,
                      double y,
                      double width,
                      double height)
               throws IOException,
                      PdfException
Draws image specified by its pathname at position (x, y) with specified width and height on this PdfDocument's current page.

Parameters:
path - pathname of the image file
x - x-coordinate of the position where the image needs to be drawn
y - y-coordinate of the position where the image needs to be drawn
width - width of the image
height - height of the image
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawImage

public void drawImage(String path,
                      double x,
                      double y,
                      double width,
                      double height,
                      double rotation)
               throws IOException,
                      PdfException
Draws image specified by its pathname rotated by rotation degrees at position (x, y) with specified width and height on this PdfDocument's current page.

The image is rotated on center of its bounding box by angle degrees in anti-clockwise direction.

Parameters:
path - pathname of the image file
x - x-coordinate of the position where the image needs to be drawn
y - y-coordinate of the position where the image needs to be drawn
width - width of the image
height - height of the image
rotation - (measured in anti-clockwise direction and expressed in degrees) tilt of the image with reference to center of its bounding box
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawImage

public void drawImage(String path,
                      double x,
                      double y,
                      double width,
                      double height,
                      double rotation,
                      String pageRange)
               throws IOException,
                      PdfException
Draws image specified by its pathname rotated by rotation degrees at position (x, y) with specified width and height on pages in specified page range.

The image is rotated on center of its bounding box by angle degrees in anti-clockwise direction.

Parameters:
path - pathname of the image file
x - x-coordinate of the position where the image needs to be drawn
y - y-coordinate of the position where the image needs to be drawn
width - width of the image
height - height of the image
rotation - (measured in anti-clockwise direction and expressed in degrees) tilt of the image with reference to center of its bounding box
pageRange - page range on whose pages the image needs to be drawn
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawImage

public void drawImage(String path,
                      double x,
                      double y,
                      double width,
                      double height,
                      String pageRange)
               throws IOException,
                      PdfException
Draws image specified by its pathname at position (x, y)with specified width and height on pages in specified page range.

Parameters:
path - pathname of the image file
x - x-coordinate of the position where the image needs to be drawn
y - y-coordinate of the position where the image needs to be drawn
width - width of the image
height - height of the image
pageRange - page range on whose pages the image needs to be drawn
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawImage

public void drawImage(String path,
                      double x,
                      double y,
                      double rotation,
                      String pageRange)
               throws IOException,
                      PdfException
Draws image specified by its pathname rotated by rotation degrees at position (x, y)on pages in specified range.

The image is rotated on center of its bounding box by angle degrees in anti-clockwise direction.

Parameters:
path - pathname of the image file
x - x-coordinate of the position where the image needs to be drawn
y - y-coordinate of the position where the image needs to be drawn
rotation - (measured in anti-clockwise direction and expressed in degrees) tilt of the image with reference to center of its bounding box
pageRange - page range on whose pages the image needs to be drawn
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawImage

public void drawImage(String path,
                      double x,
                      double y,
                      String pageRange)
               throws IOException,
                      PdfException
Draws image specified by its pathname at position (x, y) on pages in specified page range.

Parameters:
path - pathname of the image file
x - x-coordinate of the position where the image needs to be drawn
y - y-coordinate of the position where the image needs to be drawn
pageRange - page range on whose pages the image needs to be drawn
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawImage

public void drawImage(String path,
                      PdfPoint pt)
               throws IOException,
                      PdfException
Draws image specified by its pathname at specified point on this PdfDocument's current page.

Parameters:
path - pathname of the image file
pt - point where the image needs to be drawn
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawImage

public void drawImage(String path,
                      PdfPoint pt,
                      double rotation)
               throws IOException,
                      PdfException
Draws image specified by its pathname rotated by rotation degrees at specified point on this PdfDocument's current page.

The image is rotated on center of its bounding box by angle degrees in anti-clockwise direction.

Parameters:
path - pathname of the image file
pt - point where the image needs to be drawn
rotation - (measured in anti-clockwise direction and expressed in degrees) tilt of the image with reference to center of its bounding box
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawImage

public void drawImage(String path,
                      PdfPoint pt,
                      double width,
                      double height)
               throws IOException,
                      PdfException
Draws image specified by its pathname at specified point with specified width and height on this PdfDocument's current page.

Parameters:
path - pathname of the image file
pt - point where the image needs to be drawn
width - width of the image
height - height of the image
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawImage

public void drawImage(String path,
                      PdfPoint pt,
                      double width,
                      double height,
                      double rotation)
               throws IOException,
                      PdfException
Draws image specified by its pathname rotated by rotation degrees at specified point with specified width and height on this PdfDocument's current page.

The image is rotated on center of its bounding box by angle degrees in anti-clockwise direction.

Parameters:
path - pathname of the image file
pt - point where the image needs to be drawn
width - width of the image
height - height of the image
rotation - (measured in anti-clockwise direction and expressed in degrees) tilt of the image with reference to center of its bounding box
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawImage

public void drawImage(String path,
                      PdfPoint pt,
                      double width,
                      double height,
                      double rotation,
                      String pageRange)
               throws IOException,
                      PdfException
Draws image specified by its pathname rotated by rotation degrees at specified position with specified width and height on pages in specified page range.

The image is rotated on center of its bounding box by angle degrees in anti-clockwise direction.

Parameters:
path - pathname of the image file
pt - point where the image needs to be drawn
width - width of the image
height - height of the image
rotation - (measured in anti-clockwise direction and expressed in degrees) tilt of the image with reference to center of its bounding box
pageRange - page range on whose pages the image needs to be drawn
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawImage

public void drawImage(String path,
                      PdfPoint pt,
                      double width,
                      double height,
                      String pageRange)
               throws IOException,
                      PdfException
Draws image specified by its pathname at specified position with specified width and height on pages in specified range.

Parameters:
path - pathname of the image file
pt - point where the image needs to be drawn
width - width of the image
height - height of the image
pageRange - page range on whose pages the image needs to be drawn
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawImage

public void drawImage(String path,
                      PdfPoint pt,
                      double rotation,
                      String pageRange)
               throws IOException,
                      PdfException
Draws image specified by its pathname rotated by rotation degrees at specified point on pages in specified range.

The image is rotated on center of its bounding box by angle degrees in anti-clockwise direction.

Parameters:
path - pathname of the image file
pt - point where the image needs to be drawn
rotation - (measured in anti-clockwise direction and expressed in degrees) tilt of the image with reference to center of its bounding box
pageRange - page range on whose pages the image needs to be drawn
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawImage

public void drawImage(String path,
                      PdfPoint pt,
                      String pageRange)
               throws IOException,
                      PdfException
Draws image specified by its pathname at specified point on pages in specified page range.

Parameters:
path - pathname of the image file
pt - point where the image needs to be drawn
pageRange - page range on whose pages the image needs to be drawn
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawImage

public void drawImage(String path,
                      PdfRect rect)
               throws IOException,
                      PdfException
Draws image specified by its pathname inside specified rectangle on this PdfDocument's current page.

Parameters:
path - pathname of the image file
rect - rectangle inside which the image needs to be drawn
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawImage

public void drawImage(String path,
                      PdfRect rect,
                      double rotation)
               throws IOException,
                      PdfException
Draws image specified by its pathname rotated by rotation degrees inside specified rectangle on this PdfDocument's current page.

The image is rotated on center of its bounding box by angle degrees in anti-clockwise direction.

Parameters:
path - pathname of the image file
rect - rectangle inside which the image needs to be drawn
rotation - (measured in anti-clockwise direction and expressed in degrees) tilt of the image with reference to center of its bounding box
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawImage

public void drawImage(String path,
                      PdfRect rect,
                      double rotation,
                      String pageRange)
               throws IOException,
                      PdfException
Draws image specified by its pathname rotated by rotation degrees inside specified rectangle on pages in specified page range.

The image is rotated on center of its bounding box by angle degrees in anti-clockwise direction.

Parameters:
path - pathname of the image file
rect - rectangle inside which the image needs to be drawn
rotation - (measured in anti-clockwise direction and expressed in degrees) tilt of the image with reference to center of its bounding box
pageRange - page range on whose pages the image needs to be drawn
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawImage

public void drawImage(String path,
                      PdfRect rect,
                      String pageRange)
               throws IOException,
                      PdfException
Draws image specified by its pathname inside specified rectangle on pages in specified page range.

Parameters:
path - pathname of the image file
rect - rectangle inside which the image needs to be drawn
pageRange - page range on whose pages the image needs to be drawn
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawLine

public void drawLine(double startx,
                     double starty,
                     double endx,
                     double endy)
              throws IOException,
                     PdfException
Draws a line between position (startx, starty) and (endx, endy) on this PdfDocument's current page.

Parameters:
startx - x-coordinate of the position from which the line needs to be drawn
starty - y-coordinate of the position from which the line needs to be drawn
endx - x-coordinate of the position to which the line needs to be drawn
endy - y-coordinate of the position to which the line needs to be drawn
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawLine

public void drawLine(double startx,
                     double starty,
                     double endx,
                     double endy,
                     String pageRange)
              throws IOException,
                     PdfException
Draws a line between position (startx, starty) and (endx, endy) on pages in specified page range.

Parameters:
startx - x-coordinate of the position from which the line needs to be drawn
starty - y-coordinate of the position from which the line needs to be drawn
endx - x-coordinate of the position to which the line needs to be drawn
endy - y-coordinate of the position to which the line needs to be drawn
pageRange - page range on whose pages the line needs to be drawn
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawLine

public void drawLine(PdfPoint start,
                     PdfPoint end)
              throws IOException,
                     PdfException
Draws a line from start to end on this PdfDocument's current page.

Parameters:
start - starting point of the line
end - end point of the line
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawLine

public void drawLine(PdfPoint start,
                     PdfPoint end,
                     String pageRange)
              throws IOException,
                     PdfException
Draws a line from start to end on pages in specified page range.

Parameters:
start - starting point of the line
end - end point of the line
pageRange - page range on whose pages the line needs to be drawn
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawPie

public void drawPie(double x,
                    double y,
                    double width,
                    double height,
                    double startAngle,
                    double arcAngle,
                    boolean isFill,
                    boolean isStroke,
                    String pageRange)
             throws IOException,
                    PdfException
Draws a pie segment on pages in specified page range. The position (x, y) represents the top-left corner of the bounding box of an imaginary ellipse, which the pie segment can neatly fit into.

Parameters:
x - x-coordinate of top-left corner of the bounding box of the imaginary ellipse that contains the pie segment
y - y-coordinate of top-left corner of the bounding box of the imaginary ellipse that contains the pie segment
width - width of the bounding box of the imaginary ellipse that contains the pie segment
height - height of the bounding box of the imaginary pie of which the pie segment can be an integral part
startAngle - (measured in anti-clockwise direction and expressed in degrees) angle from which the pie segment needs to start
arcAngle - (expressed in degrees) angle for which the pie segment needs to span
isFill - whether the pie segment needs to be filled
isStroke - whether the pie segment needs to be stroked
pageRange - page page range on whose pages the pie segment needs to be drawn
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawPie

public void drawPie(int x,
                    int y,
                    int width,
                    int height,
                    double startAngle,
                    double arcAngle,
                    boolean isFill,
                    boolean isStroke)
             throws IOException,
                    PdfException
Draws a pie segment on this PdfDocument's current page. The position (x, y) represents the top-left corner of the bounding box of an imaginary ellipse, which the pie segment can neatly fit into.

Parameters:
x - x-coordinate of top-left corner of the bounding box of the imaginary ellipse that contains the pie segment
y - y-coordinate of top-left corner of the bounding box of the imaginary ellipse that contains the pie segment
width - width of the bounding box of the imaginary ellipse that contains the pie segment
height - height of the bounding box of the imaginary ellipse that contains the pie segment
startAngle - (measured in anti-clockwise direction and expressed in degrees) angle from which the pie segment needs to start
arcAngle - (expressed in degrees) angle for which the pie segment needs to span
isFill - whether the pie segment needs to be filled
isStroke - whether the pie segment needs to be stroked
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawPolygon

public void drawPolygon(double[] xPoints,
                        double[] yPoints,
                        int nPoints,
                        boolean isFill,
                        boolean isStroke)
                 throws IOException,
                        PdfException
Draws a polygon on this PdfDocument's current page. Arrays xPoints and yPoints contain x- and y-coordinates of certain specific points on the page. nPoints represents the number of these points, starting with the first, that need to be connected to draw the polygon.

Parameters:
xPoints - array containing x-coordinates of certain specific points on the page
yPoints - array containing y-coordinates of certain specific points on the page
nPoints - number of points that need to be connected together, starting with the first of those points represented by xPoints and yPoints, to draw the polygon
isFill - whether the polygon needs to be filled
isStroke - whether the polygon needs to be stroked
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawPolygon

public void drawPolygon(double[] xPoints,
                        double[] yPoints,
                        int nPoints,
                        boolean isFill,
                        boolean isStroke,
                        String pageRange)
                 throws IOException,
                        PdfException
Draws a polygon on pages in specified page range. Arrays xPoints and yPoints contain x- and y-coordinates of certain specific points on the page. nPoints represents the number of these points, starting with the first, that need to be connected to draw the polygon.

Parameters:
xPoints - array containing x-coordinates of certain specific points on pages in specified page range
yPoints - array containing y-coordinates of certain specific points on pages in specified page range
nPoints - number of points that need to be connected together, starting with the first of those points represented by xPoints and yPoints, to draw the polygon
isFill - whether the polygon nees to be filled
isStroke - whether the polygon needs to be stroked
pageRange - page range on whose pages the polygon needs to be drawn
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawPolyline

public void drawPolyline(double[] xPoints,
                         double[] yPoints,
                         int nPoints)
                  throws IOException,
                         PdfException
Draws a polyline on this PdfDocument's current page. Arrays xPoints and yPoints contain x- and y-coordinates of certain specific points on the page. nPoints represents the number of these points, starting with the first, that need to be connected to draw the polyline.

Parameters:
xPoints - array containing x-coordinates of certain specific points on the page
yPoints - array containing y-coordinates of certain specific points on the page
nPoints - number of points that need to be connected together, starting with the first of those points represented by xPoints and yPoints, to draw the polyline
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawPolyline

public void drawPolyline(double[] xPoints,
                         double[] yPoints,
                         int nPoints,
                         String pageRange)
                  throws IOException,
                         PdfException
Draws a polyline on pages in specified page range. Arrays xPoints and yPoints contain x- and y-coordinates of certain specific points on the page. nPoints represents the number of these points, starting with the first, that need to be connected to draw the polyline.

Parameters:
xPoints - array containing x-coordinates of certain specific points on pages in specified page rnage
yPoints - array containing y-coordinates of certain specific points on pages in specified page rnage
nPoints - number of points that need to be connected together, starting with the first of those points represented by xPoints and yPoints, to draw the polyline
pageRange - page range on whose pages the polyline needs to be drawn
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawRect

public void drawRect(double x,
                     double y,
                     double width,
                     double height)
              throws IOException,
                     PdfException
Draws a rectangle at position (x, y) with specified width and height on this PdfDocument's current page.

Parameters:
x - x-coordinate of top-left corner of the rectangle
y - y-coordinate of top-left corner of the rectangle
width - width of the rectangle
height - height of the rectangle
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawRect

public void drawRect(double x,
                     double y,
                     double width,
                     double height,
                     boolean isFill,
                     boolean isStroke)
              throws IOException,
                     PdfException
Draws a rectangle on this PdfDocument's current page at position (x, y) with specified width, height, pen, and brush settings.

Parameters:
x - x-coordinate of top-left corner of the rectangle
y - y-coordinate of top-left corner of the rectangle
width - width of the rectangle
height - height of the rectangle
isFill - whether the rectangle needs to be filled
isStroke - whether the rectangle needs to be stroked
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawRect

public void drawRect(double x,
                     double y,
                     double width,
                     double height,
                     boolean isFill,
                     boolean isStroke,
                     String pageRange)
              throws IOException,
                     PdfException
Draws a rectangle on pages in specified page range page at position (x, y) with specified width, height, brush, and pen settings.

Parameters:
x - x-coordinate of top-left corner of the rectangle
y - y-coordinate of top-left corner of the rectangle
width - width of the rectangle
height - height of the rectangle
isFill - whether the rectangle needs to be filled
isStroke - whether the rectangle needs to be stroked
pageRange - page range on whose pages the rectangle needs to be drawn
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawRect

public void drawRect(double x,
                     double y,
                     double width,
                     double height,
                     String pageRange)
              throws IOException,
                     PdfException
Draws a rectangle at position (x, y) with specified width and height on pages in specified page range.

Parameters:
x - x-coordinate of top-left corner of the rectangle
y - y-coordinate of top-left corner of the rectangle
width - width of the rectangle
height - height of the rectangle
pageRange - page range on whose pages the rectangle needs to be drawn
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawRect

public void drawRect(PdfRect r)
              throws IOException,
                     PdfException
Draws rectangle r on this PdfDocument's current page.

Parameters:
r - rectangle that needs to be drawn
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawRect

public void drawRect(PdfRect r,
                     String pageRange)
              throws IOException,
                     PdfException
Draws specified PdfRect object on pages in specified page range.

Parameters:
r - PdfRect object which needs to be drawn
pageRange - page range on whose pages the rectangle needs to be drawn
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawRect

public void drawRect(Rectangle r)
              throws IOException,
                     PdfException
Draws specified Rectangle object on this PdfDocument's current page.

Parameters:
r - Rectangle object, which needs to be drawn
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawRect

public void drawRect(Rectangle r,
                     String pageRange)
              throws IOException,
                     PdfException
Draws specified Rectangle object on pages in specified page range.

Parameters:
r - Rectangle object, which needs to be drawn
pageRange - page range on whose pages the rectangle needs to be drawn
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawRoundRect

public void drawRoundRect(double x,
                          double y,
                          double width,
                          double height,
                          double arcWidth,
                          double arcHeight,
                          boolean isFill,
                          boolean isStroke)
                   throws IOException,
                          PdfException
Draws a rectangle with rounded corners on this PdfDocument's current page. The corners of the rectangle are actually arcs whose dimensions are specified by arcWidth and arcHeight. The dimensions of the whole rectangle are specified by width and height.

Parameters:
x - x-coordinate of top-left corner of the rectangle
y - y-coordinate of top-left corner of the rectangle
width - width of the rectangle
height - height of the rectangle
arcWidth - width of the rounded corners
arcHeight - height of the rounded corners
isFill - whether the rectangle needs to be filled
isStroke - whether the rectangle needs to be stroked
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawRoundRect

public void drawRoundRect(double x,
                          double y,
                          double width,
                          double height,
                          double arcWidth,
                          double arcHeight,
                          boolean isFill,
                          boolean isStroke,
                          String pageRange)
                   throws IOException,
                          PdfException
Draws a rectangle with rounded corners on pages in specified page range. The corners of the rectangle are actually arcs whose dimensions are specified by arcWidth and arcHeight. The dimensions of the whole rectangle are specified by width and height.

Parameters:
x - x-coordinate of top-left corner of the rectangle
y - y-coordinate of top-left corner of the rectangle
width - width of the rectangle
height - height of the rectangle
arcWidth - width of the rounded corners
arcHeight - height of the rounded corners
isFill - whether the rectangle needs to be filled
isStroke - whether the rectangle needs to be stroked
pageRange - page range on whose pages the rectangle needs to be drawn
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawSquare

public void drawSquare(double x,
                       double y,
                       double length)
                throws IOException,
                       PdfException
Draws a square on this PdfDocument's current page.

Parameters:
x - x-coordinate of the top-left corner of the square
y - y-coordinate of the top-left corner of the square
length - length of a side of the square
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawSquare

public void drawSquare(double x,
                       double y,
                       double length,
                       boolean isFill,
                       boolean isStroke)
                throws IOException,
                       PdfException
Draws a square with specified brush and pen settings on this PdfDocument's current page.

Parameters:
x - x-coordinate of the top-left corner of the square
y - y-coordinate of the top-left corner of the square
length - length of a side of the square
isFill - whether the square needs to be filled
isStroke - whether the square needs to be stroked
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawSquare

public void drawSquare(double x,
                       double y,
                       double length,
                       boolean isFill,
                       boolean isStroke,
                       String pageRange)
                throws IOException,
                       PdfException
Draws a square with specified pen and brush settings on pages in specified page range.

Parameters:
x - x-coordinate of the top-left corner of the square
y - y-coordinate of the top-left corner of the square
length - length of a side of the square
isFill - whether the square needs to be filled
isStroke - whether the square needs to be stroked
pageRange - page range on whose pages the square needs to be drawn
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

drawSquare

public void drawSquare(double x,
                       double y,
                       double length,
                       String pageRange)
                throws IOException,
                       PdfException
Draws a square on pages in specified page range.

Parameters:
x - x-coordinate of the top-left corner of the square
y - y-coordinate of the top-left corner of the square
length - length of a side of the square
pageRange - page range on whose pages the square needs to be drawn
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

writeText

public void writeText(String str)
               throws PdfException,
                      IOException
Writes specified text at current position on this PdfDocument's current page.

Parameters:
str - text that needs to be written
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.
Since:
1.0
Sample Code
See example.

writeText

public void writeText(String str,
                      boolean wrap)
               throws PdfException,
                      IOException
Writes specified text with specified wrap setting at current position on this PdfDocument's current page.

Parameters:
str - text that needs to be written
wrap - constant specifying whether the text needs to be wrapped
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.
Since:
1.0
See Also:
PdfTextFormatter
Sample Code
See example.

writeText

public void writeText(String str,
                      boolean wrap,
                      String pageRange)
               throws PdfException,
                      IOException
Writes specified text with specified wrap setting at current position on pages in specified page range.

Parameters:
str - text that needs to be written
wrap - constant specifying whether the text needs to be wrapped at the margins
pageRange - page range on whose pages the text needs to be written
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.
Since:
1.0
See Also:
PdfTextFormatter
Sample Code
See example.

writeText

public void writeText(String str,
                      double x,
                      double y)
               throws PdfException,
                      IOException
Writes specified text at position (x, y) on this PdfDocument's current page.

Parameters:
str - text that needs to be written
x - x-coordinate of the position where the text needs to be written
y - y-coordinate of the position where the text needs to be written
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.
Since:
1.0
Sample Code
See example.

writeText

public void writeText(String str,
                      double x,
                      double y,
                      boolean wrap)
               throws PdfException,
                      IOException
Writes specified text with specified wrap setting at position (x, y) on this PdfDocument's current page.

Parameters:
str - text that needs to be written
x - x-coordinate of the position where the text needs
y - y-coordinate of the position where the text needs to be written
wrap - constant specifying whether the text needs to be wrapped
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.
Since:
1.0
See Also:
PdfTextFormatter
Sample Code
See example.

writeText

public void writeText(String str,
                      double x,
                      double y,
                      boolean wrap,
                      String pageRange)
               throws PdfException,
                      IOException
Writes specified text with specified wrap setting at position (x, y) on pages in specified page range.

Parameters:
str - text that needs to be written
x - x-coordinate of the position where the text needs to be written
y - y-coordinate of the position where the text needs to be written
wrap - constant specifying whether the text needs to be wrapped
pageRange - page range on whose pages the text needs to be written
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.
Since:
1.0
See Also:
PdfTextFormatter
Sample Code
See example.

writeText

public void writeText(String str,
                      double x,
                      double y,
                      double rotation)
               throws IOException,
                      PdfException
Writes specified text rotated by rotation degrees at position (x, y) on this PdfDocument's current page.

The text is rotated on center of its bounding box by angle degrees in anti-clockwise direction.

Parameters:
str - text that needs to be written
x - x-coordinate of the position where the text needs to be written
y - y-coordinate of the position where the text needs to be written
rotation - (measured in anti-clockwise direction and expressed in degrees) tilt of the text with reference to center of its bounding box
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

writeText

public void writeText(String str,
                      double x,
                      double y,
                      double rotation,
                      String pageRange)
               throws IOException,
                      PdfException
Writes specified text rotated by rotation degrees at position (x, y) on pages in specified page range.

The text is rotated on center of its bounding box by angle degrees in anti-clockwise direction.

Parameters:
str - text that needs to be written
x - x-coordinate of the position where the text needs to be written
y - y-coordinate of the position where the text needs to be written
rotation - (measured in anti-clockwise direction and expressed in degrees) tilt of the text with reference to center of its bounding box
pageRange - page range on whose pages the text needs to be written
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

writeText

public void writeText(String str,
                      double x,
                      double y,
                      int alignment)
               throws PdfException,
                      IOException
Writes specified text with specified alignment at position (x, y) on this PdfDocument's current page.

Parameters:
str - text that needs to be written
x - x-coordinate of the position where the text needs to be written
y - y-coordinate of the position where the text needs to be written
alignment - constant specifying how the text needs to be aligned
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.
Since:
1.0
See Also:
PdfTextFormatter
Sample Code
See example.

writeText

public void writeText(String str,
                      double x,
                      double y,
                      int alignment,
                      boolean wrap)
               throws IOException,
                      PdfException
Writes specified text with specified alignment and wrap setting at position (x, y) on this PdfDocument's current page.

Parameters:
str - text that needs to be written
x - x-coordinate of the position where the text needs to be written
y - y-coordinate of the position where the text needs to be written
alignment - constant specifying how the text needs to be aligned
wrap - constant specifying whether the text needs to be wrapped
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
See Also:
PdfTextFormatter
Sample Code
See example.

writeText

public void writeText(String str,
                      double x,
                      double y,
                      int alignment,
                      boolean wrap,
                      String pageRange)
               throws IOException,
                      PdfException
Writes specified text with specified alignment and wrap setting at position (x, y) on pages in specified page range.

Parameters:
str - text that needs to be written
x - x-coordinate of the position where the text needs to be written
y - y-coordinate of the position where the text needs to be written
alignment - constant specifying how the text needs to be aligned
wrap - constant specifying whether the text needs to be wrapped
pageRange - page range on whose pages the text needs to be written
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
See Also:
PdfTextFormatter
Sample Code
See example.

writeText

public void writeText(String str,
                      double x,
                      double y,
                      int alignment,
                      String pageRange)
               throws PdfException,
                      IOException
Writes specified text with specified alignment at position (x, y) on pages in specified range.

Parameters:
str - text that needs to be written
x - x-coordinate of the position where the text needs to be written
y - y-coordinate of the position where the text needs to be written
alignment - constant specifying how the text needs to be aligned
pageRange - page range on whose pages the text needs to be written
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.
Since:
1.0
See Also:
PdfTextFormatter
Sample Code
See example.

writeText

public void writeText(String str,
                      double x,
                      double y,
                      String pageRange)
               throws PdfException,
                      IOException
Writes specified text at position (x, y) on pages in specified page range.

Parameters:
str - text that needs to be written
x - x-coordinate of the position where the text needs to be written
y - y-coordinate of the position where the text needs to be written
pageRange - page range on whose pages the text needs to be written
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.
Since:
1.0
Sample Code
See example.

writeText

public void writeText(String str,
                      int alignment)
               throws PdfException,
                      IOException
Writes specified text with specified alignment at current position on this PdfDocument's current page.

Parameters:
str - text that needs to be written
alignment - constant specifying how the text needs to be aligned
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.
Since:
1.0
See Also:
PdfTextFormatter
Sample Code
See example.

writeText

public void writeText(String str,
                      int alignment,
                      boolean wrap)
               throws PdfException,
                      IOException
Writes specified text with specified alignment and specified wrap setting at current position on this PdfDocument's current page.

Parameters:
str - text that needs to be written
alignment - constant specifying how the text needs to be aligned
wrap - constant specifying whether the text needs to be wrapped
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.
Since:
1.0
See Also:
PdfTextFormatter
Sample Code
See example.

writeText

public void writeText(String str,
                      int alignment,
                      boolean wrap,
                      String pageRange)
               throws PdfException,
                      IOException
Writes specified text with specified alignment and wrap setting at current position on pages in specified page range.

Parameters:
str - text that needs to be written
alignment - constant specifying how the text needs to be aligned
wrap - constant specifying whether the text needs to be wrapped
pageRange - page range on whose pages the text needs to be written
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.
Since:
1.0
See Also:
PdfTextFormatter
Sample Code
See example.

writeText

public void writeText(String str,
                      int alignment,
                      String pageRange)
               throws PdfException,
                      IOException
Writes specified text with specified alignment at current position on pages in specified page range.

Parameters:
str - text that needs to be written
alignment - constant specifying how the text needs to be aligned
pageRange - page range on whose pages the text needs to be written
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.
Since:
1.0
See Also:
PdfTextFormatter
Sample Code
See example.

writeText

public void writeText(String str,
                      PdfFont f)
               throws PdfException,
                      IOException
Writes specified text with specified font on this PdfDocument's current page.

Parameters:
str - text that needs to be written
f - font with which the text needs to be written
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.
Since:
1.0
Sample Code
See example.

writeText

public void writeText(String str,
                      PdfFont f,
                      boolean wrap)
               throws PdfException,
                      IOException
Writes specified text with specified wrap setting and font on this PdfDocument's current page.

Parameters:
str - text that needs to be written
f - font with which the text needs to be written
wrap - constant specifying whether the text needs to be wrapped
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.
Since:
1.0
See Also:
PdfTextFormatter
Sample Code
See example.

writeText

public void writeText(String str,
                      PdfFont f,
                      boolean wrap,
                      String pageRange)
               throws PdfException,
                      IOException
Writes specified text with specified font and wrap setting on pages in specified page range.

Parameters:
str - text that needs to be written
f - font with which the text needs to be written
wrap - constant specifying whether the text needs to be wrapped
pageRange - page range on whose pages the text needs to be written
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.
Since:
1.0
See Also:
PdfTextFormatter
Sample Code
See example.

writeText

public void writeText(String str,
                      PdfFont f,
                      double x,
                      double y)
               throws PdfException,
                      IOException
Writes specified text with specified font at position (x, y) on this PdfDocument's current page.

Parameters:
str - text that needs to be written
f - font with which the text needs to be written
x - x-coordinate of the position where the text needs to be written
y - y-coordinate of the position where the text needs to be written
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.
Since:
1.0
Sample Code
See example.

writeText

public void writeText(String str,
                      PdfFont f,
                      double x,
                      double y,
                      boolean wrap)
               throws IOException,
                      PdfException
Writes specified text with specified font and wrap setting at position (x, y) on this PdfDocument's current page.

Parameters:
str - text that needs to be written
f - font with which the text needs to be written
x - x-coordinate of the position where the text needs to be written
y - y-coordinate of the position where the text needs to be written
wrap - constant specifying whether the text needs to be wrapped
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
See Also:
PdfTextFormatter
Sample Code
See example.

writeText

public void writeText(String str,
                      PdfFont f,
                      double x,
                      double y,
                      boolean wrap,
                      String pageRange)
               throws IOException,
                      PdfException
Writes specified text with specified font and wrap setting at position (x, y) on pages in specified page range.

Parameters:
str - text that needs to be written
f - font with which the text needs to be written
x - x-coordinate of the position where the text needs to be written
y - y-coordinate of the position where the text needs to be written
wrap - constant specifying whether the text needs to be wrapped
pageRange - page range on whose pages the text needs to be written
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
See Also:
PdfTextFormatter
Sample Code
See example.

writeText

public void writeText(String str,
                      PdfFont f,
                      double x,
                      double y,
                      double rotation)
               throws IOException,
                      PdfException
Writes specified text rotated by rotation degrees with specified font at position (x, y) on this PdfDocument's current page.

The text is rotated on center of its bounding box by angle degrees in anti-clockwise direction.

Parameters:
str - text that needs to be written
f - font with which the text needs to be written
x - x-coordinate of the position where the text needs to be written
y - y-coordinate of the position where the text needs to be written
rotation - (measured in anti-clockwise direction and expressed in degrees) tilt of the text with reference to center of its bounding box
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

writeText

public void writeText(String str,
                      PdfFont f,
                      double x,
                      double y,
                      double rotation,
                      String pageRange)
               throws IOException,
                      PdfException
Writes specified text rotated by rotation degrees with specified font at position (x, y) on pages in specified page range.

The text is rotated on center of its bounding box by angle degrees in anti-clockwise direction.

Parameters:
str - text that needs to be written
f - font with which the text needs to be written
x - x-coordinate of the position where the text needs to be written
y - y-coordinate of the position where the text needs to be written
rotation - (measured in anti-clockwise direction and expressed in degrees) tilt of the text with reference to center of its bounding box
pageRange - page range on whose pages the text needs to be written
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

writeText

public void writeText(String str,
                      PdfFont f,
                      double x,
                      double y,
                      String pageRange)
               throws PdfException,
                      IOException
Writes specified text with specified font at position (x, y) on pages in specified page range.

Parameters:
str - text that needs to be written
f - font with which the text needs to be written
x - x-coordinate of the position where the text needs to be written
y - y-coordinate of the position where the text needs to be written
pageRange - page range on whose pages the text needs to be written
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.
Since:
1.0
Sample Code
See example.

writeText

public void writeText(String str,
                      PdfFont f,
                      int alignment)
               throws PdfException,
                      IOException
Writes specified text with specified font and alignment on this PdfDocument's current page.

Parameters:
str - text that needs to be written
f - font with which the text needs to be written
alignment - constant specifying how the text needs to be aligned
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.
Since:
1.0
See Also:
PdfTextFormatter
Sample Code
See example.

writeText

public void writeText(String str,
                      PdfFont f,
                      int alignment,
                      boolean wrap)
               throws PdfException,
                      IOException
Writes specified text with specified font, alignment, and wrap setting on this PdfDocument's current page.

Parameters:
str - text that needs to be written
f - font with which the text needs to be written
alignment - constant specifying how the text needs to be aligned
wrap - constant specifying whether the text needs to be wrapped
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.
Since:
1.0
See Also:
PdfTextFormatter
Sample Code
See example.

writeText

public void writeText(String str,
                      PdfFont f,
                      int alignment,
                      boolean wrap,
                      String pageRange)
               throws PdfException,
                      IOException
Writes specified text with specified font, alignment and wrap setting on pages in specified page range.

Parameters:
str - text that needs to be written
f - font with which the text needs to be written
alignment - constant specifying how the text needs to be aligned
wrap - constant specifying whether the text needs to be wrapped
pageRange - page range on whose pages the text needs to be written
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.
Since:
1.0
See Also:
PdfTextFormatter
Sample Code
See example.

writeText

public void writeText(String str,
                      PdfFont f,
                      int alignment,
                      double x,
                      double y)
               throws IOException,
                      PdfException
Writes specified text with specified font and alignment at position (x, y) on this PdfDocument's current page.

Parameters:
str - text that needs to be written
f - font with which the text needs to be written
alignment - constant specifying how the text needs to be aligned
x - x-coordinate of the position where the text needs to be written
y - y-coordinate of the position where the text needs to be written
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
See Also:
PdfTextFormatter
Sample Code
See example.

writeText

public void writeText(String str,
                      PdfFont f,
                      int alignment,
                      double x,
                      double y,
                      boolean wrap)
               throws IOException,
                      PdfException
Writes specified text with specified font, alignment, and wrapping at position (x, y) on this PdfDocument's current page.

Parameters:
str - text that needs to be written
f - font with which the text needs to be written
alignment - constant specifying how the text needs to be aligned
x - x-coordinate of the position where the text needs to be written
y - y-coordinate of the position where the text needs to be written
wrap - constant specifying whether the text needs to be wrapped
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
See Also:
PdfTextFormatter
Sample Code
See example.

writeText

public void writeText(String str,
                      PdfFont f,
                      int alignment,
                      double x,
                      double y,
                      boolean wrap,
                      String pageRange)
               throws IOException,
                      PdfException
Writes specified text with specified font, alignment, and wrapping at position (x, y) on pages in specified page range.

Parameters:
str - text that needs to be written
f - font with which the text needs to be written
alignment - constant specifying how the text needs to be aligned
x - x-coordinate of the position where the text needs to be written
y - y-coordinate of the position where the text needs to be written
wrap - constant specifying whether the text needs to be wrapped
pageRange - page range on whose pages the text needs to be written
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
See Also:
PdfTextFormatter
Sample Code
See example.

writeText

public void writeText(String str,
                      PdfFont f,
                      int alignment,
                      double x,
                      double y,
                      String pageRange)
               throws IOException,
                      PdfException
Writes specified text with specified font and alignment at position (x, y) on pages in specified page range.

Parameters:
str - text that needs to be written
f - font with which the text needs to be written
alignment - constant specifying how the text needs to be aligned
x - x-coordinate of the position where the text needs to be written
y - y-coordinate of the position where the text needs to be written
pageRange - page range on whose pages the text needs to be written
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
See Also:
PdfTextFormatter
Sample Code
See example.

writeText

public void writeText(String str,
                      PdfFont f,
                      int alignment,
                      PdfPoint pt)
               throws IOException,
                      PdfException
Writes specified text with specified font and alignment at specified point on this PdfDocument's current page.

Parameters:
str - text that needs to be written
f - font with which the text needs to be written
alignment - constant specifying how the text needs to be aligned
pt - PdfPoint where the text needs to be written
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
See Also:
PdfTextFormatter
Sample Code
See example.

writeText

public void writeText(String str,
                      PdfFont f,
                      int alignment,
                      PdfPoint pt,
                      boolean wrap)
               throws IOException,
                      PdfException
Writes specified text with specified font, alignment, and wrap setting at specified point on this PdfDocument's current page.

Parameters:
str - text that needs to be written
f - font with which the text needs to be written
alignment - constant specifying how the text needs to be aligned
pt - PdfPoint where the text needs to be written
wrap - constant specifying whether the text needs to be wrapped
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
See Also:
PdfTextFormatter
Sample Code
See example.

writeText

public void writeText(String str,
                      PdfFont f,
                      int alignment,
                      PdfPoint pt,
                      boolean wrap,
                      String pageRange)
               throws IOException,
                      PdfException
Writes specified text with specified font, alignment, and wrap setting at specified point on pages in specified page range.

Parameters:
str - text that needs to be written
f - font with which the text needs to be written
alignment - constant specifying how the text needs to be aligned
pt - PdfPoint where the text needs to be written
wrap - constant specifying whether the text needs to be wrapped
pageRange - page range on whose pages the text needs to be written
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
See Also:
PdfTextFormatter
Sample Code
See example.

writeText

public void writeText(String str,
                      PdfFont f,
                      int alignment,
                      PdfPoint pt,
                      String pageRange)
               throws IOException,
                      PdfException
Writes specified text with specified font and alignment at specified point on pages in specified page range.

Parameters:
str - text that needs to be written
f - font with which the text needs to be written
alignment - constant specifying how the text needs to be aligned
pt - PdfPoint where the text needs to be written
pageRange - page range on whose pages the text needs to be written
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
See Also:
PdfTextFormatter
Sample Code
See example.

writeText

public void writeText(String str,
                      PdfFont f,
                      int alignment,
                      String pageRange)
               throws PdfException,
                      IOException
Writes specified text with specified font and alignment on pages in specified page range.

Parameters:
str - text that needs to be written
f - font with which the text needs to be written
alignment - constant specifying how the text needs to be aligned
pageRange - page range on whose pages the text needs to be written
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.
Since:
1.0
See Also:
PdfTextFormatter
Sample Code
See example.

writeText

public void writeText(String str,
                      PdfFont f,
                      PdfPoint pt)
               throws PdfException,
                      IOException
Writes specified text with specified font at specified point on this PdfDocument's current page.

Parameters:
str - text that needs to be written
f - font with which the text needs to be written
pt - PdfPoint where the text needs to be written
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.
Since:
1.0
Sample Code
See example.

writeText

public void writeText(String str,
                      PdfFont f,
                      PdfPoint pt,
                      boolean wrap)
               throws IOException,
                      PdfException
Writes text str with specified font and wrap setting at specified point on this PdfDocument's current page.

Parameters:
str - text that needs to be written
f - font with which the text needs to be written
pt - PdfPoint where the text needs to be written
wrap - constant specifying whether the text needs to be wrapped
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
See Also:
PdfTextFormatter
Sample Code
See example.

writeText

public void writeText(String str,
                      PdfFont f,
                      PdfPoint pt,
                      boolean wrap,
                      String pageRange)
               throws IOException,
                      PdfException
Writes text str with specified font and wrap setting at specified point on pages in specified page range.

Parameters:
str - text that needs to be written
f - font with which the text needs to be written
pt - PdfPoint where the text needs to be written
wrap - constant specifying whether the text needs to be wrapped
pageRange - page range on whose pages the text needs to be written
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
See Also:
PdfTextFormatter
Sample Code
See example.

writeText

public void writeText(String str,
                      PdfFont f,
                      PdfPoint pt,
                      double rotation)
               throws IOException,
                      PdfException
Writes text str rotated by rotation degrees with specified font at specified point on this PdfDocument's current page.

The text is rotated on center of its bounding box by angle degrees in anti-clockwise direction.

Parameters:
str - text that needs to be written
f - font with which the text needs to be written
pt - PdfPoint where the text needs to be written
rotation - (measured in anti-clockwise direction and expressed in degrees) tilt of the text with reference to center of its bounding box
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

writeText

public void writeText(String str,
                      PdfFont f,
                      PdfPoint pt,
                      double rotation,
                      String pageRange)
               throws IOException,
                      PdfException
Writes text str rotated by rotation degrees with specified font at specified point on pages in specified page range.

The text is rotated on center of its bounding box by angle degrees in anti-clockwise direction.

Parameters:
str - text that needs to be written
f - text that needs to be written
pt - PdfPoint where the text needs to be written
rotation - (measured in anti-clockwise direction and expressed in degrees) tilt of the text with reference to center of its bounding box
pageRange - page range on whose pages the text needs to be written
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

writeText

public void writeText(String str,
                      PdfFont f,
                      PdfPoint pt,
                      String pageRange)
               throws PdfException,
                      IOException
Writes specified text with specified font at specified point on pages in specified page range.

Parameters:
str - text that needs to be written
f - font with which the text needs to be written
pt - PdfPoint where the text needs to be written
pageRange - page range on whose pages the text needs to be written
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.
Since:
1.0
Sample Code
See example.

writeText

public void writeText(String str,
                      PdfFont f,
                      PdfRect rectangle)
               throws PdfException,
                      IOException
Writes specified text with specified font inside specified rectangle on this PdfDocument's current page.

Parameters:
str - text that needs to be written
f - font with which the text needs to be written
rectangle - rectangle inside which the text needs to be written
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.
Since:
1.0
Sample Code
See example.

writeText

public void writeText(String str,
                      PdfFont f,
                      PdfRect rectangle,
                      double rotation,
                      double firstLinePosition)
               throws IOException,
                      PdfException
Writes specified text rotated by rotation degrees with specified font and first-line position inside specified rectangle on this PdfDocument's current page.

The text is rotated on center of its bounding box by angle degrees in anti-clockwise direction.

Parameters:
str - text that needs to be written
f - font with which the text needs to be written
rectangle - rectangle inside which the text needs to be written
rotation - (measured in anti-clockwise direction and expressed in degrees) tilt of the text with reference to center of its bounding box
firstLinePosition - position inside the rectangle where the first line of text should begin (Applied in current measurement unit)
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

writeText

public void writeText(String str,
                      PdfFont f,
                      PdfRect rectangle,
                      double rotation,
                      double firstLinePosition,
                      String pageRange)
               throws IOException,
                      PdfException
Writes specified text rotated by rotation degrees with specified font and first-line position inside specified rectangle on pages in specified page range.

The text is rotated on center of its bounding box by angle degrees in anti-clockwise direction.

Parameters:
str - text that needs to be written
f - text that needs to be written
rectangle - rectangle inside which the text needs to be written
rotation - (measured in anti-clockwise direction and expressed in degrees) tilt of the text with reference to center of its bounding box
firstLinePosition - position inside the rectangle where the first line of text should begin (Applied in current measurement unit)
pageRange - page range on whose pages the text needs to be written
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

writeText

public void writeText(String str,
                      PdfFont f,
                      PdfRect rectangle,
                      int alignment)
               throws IOException,
                      PdfException
Writes specified text with specified alignment and font inside specified rectangle on this PdfDocument's current page.

Parameters:
str - text that needs to be written
f - font with which the text needs to be written
rectangle - rectangle inside which the text needs to be written
alignment - constant specifying how the text needs to be aligned inside the rectangle
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
See Also:
PdfTextFormatter
Sample Code
See example.

writeText

public void writeText(String str,
                      PdfFont f,
                      PdfRect rectangle,
                      int alignment,
                      double rotation,
                      double firstLinePosition)
               throws IOException,
                      PdfException
Writes specified text rotated by rotation degrees with specified alignment, first-line position, and font inside specified rectangle on this PdfDocument's current page.

The text is rotated on center of its bounding box by angle degrees in anti-clockwise direction.

Parameters:
str - text that needs to be written
f - font with which the text needs to be written
rectangle - rectangle inside which the text needs to be written
alignment - constant specifying how the text needs to be aligned inside the rectangle
rotation - (measured in anti-clockwise direction and expressed in degrees) tilt of the text with reference to center of its bounding box
firstLinePosition - position inside the rectangle where the first line of text should begin (Applied in current measurement unit)
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
See Also:
PdfTextFormatter
Sample Code
See example.

writeText

public void writeText(String str,
                      PdfFont f,
                      PdfRect rectangle,
                      int alignment,
                      double rotation,
                      double firstLinePosition,
                      String pageRange)
               throws IOException,
                      PdfException
Writes specified text rotated by rotation degrees with specified alignment, first-line position, and font inside specified rectangle on pages in specified page range.

The text is rotated on center of its bounding box by angle degrees in anti-clockwise direction.

Parameters:
str - text that needs to be written
f - text that needs to be written
rectangle - rectangle inside which the text needs to be written
alignment - constant specifying how the text needs to be aligned inside the rectangle
rotation - (measured in anti-clockwise direction and expressed in degrees) tilt of the text with reference to center of its bounding box
firstLinePosition - position inside the rectangle where the first line of text should begin (Applied in current measurement unit)
pageRange - page range on whose pages the text needs to be written
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
See Also:
PdfTextFormatter
Sample Code
See example.

writeText

public void writeText(String str,
                      PdfFont f,
                      PdfRect rectangle,
                      int alignment,
                      String pageRange)
               throws IOException,
                      PdfException
Writes specified text with specified font and alignment inside specified rectangle on pages in specified page range.

Parameters:
str - text that needs to be written
f - font with which the text needs to be written
rectangle - rectangle inside which the text needs to be written
alignment - constant specifying how the text needs to be aligned inside the rectangle
pageRange - page range on whose pages the text needs to be written
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
See Also:
PdfTextFormatter
Sample Code
See example.

writeText

public void writeText(String str,
                      PdfFont f,
                      PdfRect rectangle,
                      String pageRange)
               throws PdfException,
                      IOException
Writes specified text with specified font inside specified rectangle on pages in specified page range.

Parameters:
str - text that needs to be written
f - font with which the text needs to be written
rectangle - rectangle inside which the text needs to be written
pageRange - page range on whose pages the text needs to be written
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.
Since:
1.0
Sample Code
See example.

writeText

public void writeText(String str,
                      PdfFont f,
                      String pageRange)
               throws PdfException,
                      IOException
Writes specified text with specified font on pages in specified page range.

Parameters:
str - text that needs to be written
f - font with which the text needs to be written
pageRange - page range on whose pages the text needs to be written
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.
Since:
1.0
Sample Code
See example.

writeText

public void writeText(String str,
                      PdfPoint pt)
               throws PdfException,
                      IOException
Writes specified text at specified point on this PdfDocument's current page.

Parameters:
str - text that needs to be written
pt - PdfPoint where the text needs to be written
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.
Since:
1.0
Sample Code
See example.

writeText

public void writeText(String str,
                      PdfPoint pt,
                      boolean wrap)
               throws PdfException,
                      IOException
Writes text str with specified wrap setting at point pt on this PdfDocument's current page.

Parameters:
str - text that needs to be written
pt - PdfPoint where the text needs to be written
wrap - constant specifying whether the text needs to be wrapped
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.
Since:
1.0
See Also:
PdfTextFormatter
Sample Code
See example.

writeText

public void writeText(String str,
                      PdfPoint pt,
                      boolean wrap,
                      String pageRange)
               throws PdfException,
                      IOException
Writes text str with specified wrap setting at point pt on pages in specified page range.

Parameters:
str - text that needs to be written
pt - PdfPoint where the text needs to be written
wrap - constant specifying whether the text needs to be wrapped
pageRange - page range on whose pages the text needs to be written
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.
Since:
1.0
See Also:
PdfTextFormatter
Sample Code
See example.

writeText

public void writeText(String str,
                      PdfPoint pt,
                      double rotation)
               throws IOException,
                      PdfException
Writes text str, rotated by rotation degrees, at point pt on this PdfDocument's current page.

The text is rotated on center of its bounding box by angle degrees in anti-clockwise direction.

Parameters:
str - text that needs to be written
pt - PdfPoint where the text needs to be written
rotation - (measured in anti-clockwise direction and expressed in degrees) tilt of the text with reference to center of its bounding box
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

writeText

public void writeText(String str,
                      PdfPoint pt,
                      double rotation,
                      String pageRange)
               throws IOException,
                      PdfException
Writes text str, rotated rotation degrees, at point pt on pages in specified page range.

The text is rotated on center of its bounding box by angle degrees in anti-clockwise direction.

Parameters:
str - text that needs to be written
pt - PdfPoint where the text needs to be written
rotation - (measured in anti-clockwise direction and expressed in degrees) tilt of the text with reference to center of its bounding box
pageRange - page range on whose pages the text needs to be written
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

writeText

public void writeText(String str,
                      PdfPoint pt,
                      int alignment,
                      boolean wrap)
               throws IOException,
                      PdfException
Writes text str with specified alignment and wrap setting at point pt on this PdfDocument's current page.

Parameters:
str - text that needs to be written
pt - PdfPoint where the text needs to be written
alignment - constant specifying how the text needs to be aligned
wrap - constant specifying whether the text needs to be wrapped
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
See Also:
PdfTextFormatter
Sample Code
See example.

writeText

public void writeText(String str,
                      PdfPoint pt,
                      int alignment,
                      boolean wrap,
                      String pageRange)
               throws IOException,
                      PdfException
Writes text str with specified alignment and wrap setting at point pt on pages in specified page range.

Parameters:
str - text that needs to be written
pt - PdfPoint where the text needs to be written
alignment - constant specifying how the text needs to be aligned
wrap - constant specifying whether the text needs to be wrapped
pageRange - page range on whose pages the text needs to be written
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
See Also:
PdfTextFormatter
Sample Code
See example.

writeText

public void writeText(String str,
                      PdfPoint pt,
                      String pageRange)
               throws PdfException,
                      IOException
Writes specified text at specified point on pages in specified page range.

Parameters:
str - text that needs to be written
pt - PdfPoint where the text needs to be written
pageRange - page range on whose pages the text needs to be written
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.
Since:
1.0
Sample Code
See example.

writeText

public void writeText(String str,
                      PdfRect rectangle)
               throws PdfException,
                      IOException
Writes specified text inside specified rectangle on this PdfDocument's current page.

Parameters:
str - text that needs to be written
rectangle - rectangle inside which the text needs to be written
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.
Since:
1.0
Sample Code
See example.

writeText

public void writeText(String str,
                      PdfRect rectangle,
                      double rotation,
                      double firstLinePosition)
               throws IOException,
                      PdfException
Writes specified text rotated by rotation degrees with specified first-line position inside specified rectangle on this PdfDocument's current page.

The text is rotated on center of its bounding box by angle degrees in anti-clockwise direction.

Parameters:
str - text that needs to be written
rectangle - rectangle inside which the text needs to be written
rotation - (measured in anti-clockwise direction and expressed in degrees) tilt of the text with reference to center of its bounding box
firstLinePosition - position inside the rectangle where the first line of text should begin (Applied in current measurement unit)
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

writeText

public void writeText(String str,
                      PdfRect rectangle,
                      double rotation,
                      double firstLinePosition,
                      String pageRange)
               throws IOException,
                      PdfException
Writes specified text rotated by rotation degrees with specified first-line position inside specified rectangle on pages in specified page range.

The text is rotated on center of its bounding box by angle degrees in anti-clockwise direction.

Parameters:
str - text that needs to be written
rectangle - rectangle inside which the text needs to be written
rotation - (measured in anti-clockwise direction and expressed in degrees) tilt of the text with reference to center of its bounding box
firstLinePosition - position inside the rectangle where the first line of text should begin (Applied in current measurement unit)
pageRange - page range on whose pages the text needs to be written
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
Sample Code
See example.

writeText

public void writeText(String str,
                      PdfRect rectangle,
                      int alignment)
               throws PdfException,
                      IOException
Writes specified text with specfied text alignment on this PdfDocument's current page.

Parameters:
str - text that needs to be written
rectangle - rectangle inside which the text needs to be written
alignment - constant specifying how the text needs to be aligned inside the rectangle
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.
Since:
1.0
See Also:
PdfTextFormatter
Sample Code
See example.

writeText

public void writeText(String str,
                      PdfRect rectangle,
                      int alignment,
                      double rotation,
                      double firstLinePosition)
               throws IOException,
                      PdfException
Writes specified text rotated by rotation degrees with specified first-line position inside specified rectangle on this PdfDocument's current page.

The text is rotated on center of its bounding box by angle degrees in anti-clockwise direction.

Parameters:
str - text that needs to be written
rectangle - rectangle inside which the text needs to be written
alignment - constant specifying how the text needs to be aligned inside the rectangle
rotation - (measured in anti-clockwise direction and expressed in degrees) tilt of the text with reference to center of its bounding box
firstLinePosition - position inside the rectangle where the first line of text should begin (Applied in current measurement unit)
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
See Also:
PdfTextFormatter
Sample Code
See example.

writeText

public void writeText(String str,
                      PdfRect rectangle,
                      int alignment,
                      double rotation,
                      double firstLinePosition,
                      String pageRange)
               throws IOException,
                      PdfException
Writes specified text rotated by rotation degrees with specified alignment and first-line position inside specified rectangle on pages in specified page range.

The text is rotated on center of its bounding box by angle degrees in anti-clockwise direction.

Parameters:
str - text that needs to be written
rectangle - rectangle inside which the text needs to be written
alignment - how the text needs to be aligned inside the rectangle
rotation - (measured in anti-clockwise direction and expressed in degrees) tilt of the text with reference to center of its bounding box
firstLinePosition - position inside the rectangle where the first line of text should begin (Applied in current measurement unit)
pageRange - page range on whose pages the text needs to be written
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
Since:
1.0
See Also:
PdfTextFormatter
Sample Code
See example.

writeText

public void writeText(String str,
                      PdfRect rectangle,
                      int alignment,
                      String pageRange)
               throws PdfException,
                      IOException
Writes specified text with specified alignment inside specified rectangle on pages in specified page range.

Parameters:
str - text that needs to be written
rectangle - rectangle inside which the text needs to be written
alignment - constant specifying how the text needs to be aligned inside the rectangle
pageRange - page range on whose pages the text needs to be written
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.
Since:
1.0
See Also:
PdfTextFormatter
Sample Code
See example.

writeText

public void writeText(String str,
                      PdfRect rectangle,
                      String pageRange)
               throws PdfException,
                      IOException
Writes specified text inside specified rectangle on pages in specified page range.

Parameters:
str - text that needs to be written
rectangle - rectangle inside which the text needs to be written
pageRange - page range on whose pages the text needs to be written
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.
Since:
1.0
Sample Code
See example.

writeText

public void writeText(String str,
                      Point pt,
                      int alignment)
               throws PdfException,
                      IOException
Writes specified text at position pt on current page with specified text alignment.

Parameters:
str - text that needs to be rendered
pt - position on the pages where the text needs to be rendered
alignment - constant specifyinmg alignment of text with respect to page margins
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.
See Also:
Text alignment constants specified in PdfTextFormatter class.

writeText

public void writeText(String str,
                      Point pt,
                      int alignment,
                      String pageRange)
               throws PdfException,
                      IOException
Writes specified text at position pt with specified text alignment on all pages of a specified page range.

Parameters:
str - text that needs to be rendered
pt - position on the pages where the text needs to be rendered
alignment - constant specifyinmg alignment of text with respect to page margins
pageRange - pages where the text needs to be rendered
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.
See Also:
Text alignment constants specified in PdfTextFormatter class.

writeText

public void writeText(String str,
                      String pageRange)
               throws PdfException,
                      IOException
Writes specified text at current position on pages in specified page range.

Parameters:
str - text that needs to be written
pageRange - page range on whose pages the text needs to be written
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.
Since:
1.0
Sample Code
See example.

setFont

public void setFont(PdfFont defaultFont)
             throws PdfException
Specifies default font that needs to be used to render text elements in the document. The default font is used by methods such as PdfStdDocument.writeText(String), which do not explicitly specify a font for rendering, unlike say PdfStdDocument.writeText(String, PdfFont). If a default font was not explicitly specified, Helvetica 10 pt will be used.

Parameters:
defaultFont - default font that needs to render text elements
Throws:
PdfException - if an illegal argument is supplied.
See Also:
PdfStdDocument.getFont()

getFont

public PdfFont getFont()
Returns default font used to render text elements in the document.

If a default font was not explicitly specified earlier, the method returns PDF font object for Helvetica 10 pt.

Returns:
default font used by this API to render text elements with this PdfDocument object
See Also:
PdfStdDocument.setFont(PdfFont)

setCph

public void setCph(PdfCustomPlaceholderHandler cph)
            throws PdfException
Ensures that the onCustomPlaceHolder() event handler is called for the specified user-class instance when a custom placeholder is encountered in a text-rendering operation. Use the event handler to specify values for the passed placeholder.

Parameters:
cph - user-class instance whose onCustomPlaceHolder() needs to be called
Throws:
PdfException

addPageBreak

public void addPageBreak()
                  throws PdfException,
                         IOException
(In document creation mode,) adds a new page and makes it the current page for subsequent rendering operations; (in document reading mode,) makes the next page as the current page for subsequent rendering operations. In creation mode, this method offers a quick way to add a new page similar to the current page.

To modify the size and margins of the newly created page, implement the PdfAutoPageCreationHandler interface and handle the PdfAutoPageCreationHandler.onAutoPageCreation(PdfDocument, int) event. To make the document object invoke the event, set the event handler with PdfStdDocument.setAutoPageCreationHandler(PdfAutoPageCreationHandler).

Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.

setAutoPageCreationHandler

public void setAutoPageCreationHandler(PdfAutoPageCreationHandler autoPageCreationHandler)
Ensures that the onAutoPageCreation() event handler of specified user-class instance is called when a new page is automatically created to accommodate a content-rendering operation. Use the event handler to specify custom page margins of for the newly created page.

Parameters:
autoPageCreationHandler - user-class instance whose onAutoPageCreation() needs to be called

isLoaded

public boolean isLoaded()

getInputFileName

public String getInputFileName()
Returns name of the file from which the document was loaded.

Returns:
name of the file; null if document is not loaded from a file
See Also:
PdfStdDocument.getInputFilePath()

getInputFilePath

public String getInputFilePath()
Returns parent directory path of the file from which this document was loaded.

Returns:
pathname of the directory containing the file; null if document is not loaded from a file
See Also:
PdfStdDocument.getInputFileName()

Gnostice PDFOne
Pro. Ed. v5.0.0

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