Gnostice PDFOne
Pro. Ed. v5.0.0


com.gnostice.pdfone
Class PdfPage

java.lang.Object
  extended bycom.gnostice.pdfone.PdfNode
      extended bycom.gnostice.pdfone.PdfStdPage
          extended bycom.gnostice.pdfone.PdfProPage
              extended bycom.gnostice.pdfone.PdfPage
All Implemented Interfaces:
Cloneable, Usable

public final class PdfPage
extends com.gnostice.pdfone.PdfProPage

This class represents a PDF page. PdfPage offers numerous methods to work with elements such as text, shapes, images, annotations, and bookmarks.

After content is written to a page, it is usually added to a PdfDocument object using the PdfDocument.add(PdfPage) method. A PdfPage object can be cloned using the clone() method and then added to a PdfDocument one more time. However, the same PdfPage object can be added to multiple PdfDocument object without cloning.

  // Creates several PdfDocument objects
  PdfDocument doc1 = ...
  PdfDocument doc2 = ...
  PdfDocument doc1 = ...
  ...
  PdfDocument docn = ...
  
  // Creates a PdfPage object
  PdfPage page = new PdfPage();
  
  // Performs operations with the above PdfPage object
  ...
  
  // Adds the same PdfPage object to the PdfDocument objects 
  // created above
   doc1.add(page); 
   doc2.add(page); 
   doc3.add(page); 
   ...  
   docn.add(page);  
  
  ...

While writing to a page, 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 page. Whenever coordinates, position, or sizes are used, they are usually applied in terms of the page's current measurement unit, which can be centimeters, inches, pixels, points, and twips. However, in situations where a measurement unit cannot be applied or determined, the measurement unit will be by default points.

Every page 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.

Since:
1.0
Version:
1.0

Field Summary
static int COLORSPACE_CMYK
          Constant specifying CMYK (Cyan-Magenta-Yellow-blacK) colorspace.
static int COLORSPACE_RGB
          Constant specifing RGB (Red-Green-Blue) colorspace.
static int HP_LEFT
          Constant to specify horizontal alignment to the left (inside header, footer and watermarks)
static int HP_MIDDLE
          Constant to specify horizontal alignment to the middle (inside header, footer and watermarks)
static int HP_RIGHT
          Constant to specify horizontal alignment to the right (inside header, footer and watermarks)
static boolean OVERLAY
          Constant to specify z-order overlay
static boolean UNDERLAY
          Constant to specify z-order underlay
static int VP_BOTTOM
          Constant to specify vertical alignment to the bottom (inside header, footer and watermarks)
static int VP_CENTRE
          Constant to specify vertical alignment to the center (inside header, footer and watermarks)
static int VP_TOP
          Constant to specify vertical alignment to the top (inside header, footer and watermarks)
 
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
PdfPage()
          Zero-argument default constructor.
PdfPage(double width, double height)
          Constructs a page with specified width and height.
PdfPage(double width, double height, double pageHeaderHeight, double pageFooterHeight, double pageLeftMargin, double pageTopMargin, double pageRightMargin, double pageBottomMargin, int measurementUnit)
          Constructs a page with its width, height, header height, footer height, and margins specified in specified unit.
PdfPage(double width, double height, double pageLeftMargin, double pageTopMargin, double pageRightMargin, double pageBottomMargin, int measurementUnit)
          Constructs a page with specified width, height, and margins (in specified measurement unit).
PdfPage(double width, double height, int measurementUnit)
          Constructs a page with specified width and height (in specified measurement unit).
PdfPage(int pageSize)
          Constructs a page with specified size.
PdfPage(int pageSize, double pageHeaderHeight, double pageFooterHeight, double pageLeftMargin, double pageTopMargin, double pageRightMargin, double pageBottomMargin, int measurementUnit)
          Constructs a page with specified size, header height, footer height, and margins (in specified measurement unit).
PdfPage(int pageSize, double pageLeftMargin, double pageTopMargin, double pageRightMargin, double pageBottomMargin, int measurementUnit)
          Constructs a page with specified size and margins (in specified measurement unit).
 
Method Summary
 void addAction(int event, int namedAction)
          Adds specified named action for specified trigger event.
 void addAction(int event, int actionType, String javascriptOrURI)
          Adds action of resolving specified Uniform Resource Identifier URI) or executing a JavaScript script for the specified event.
 void addAction(int event, int actionType, String applicationToLaunch, boolean isPrint)
          Adds action of launching specified application, or displaying or printing specified file for the specified event.
 void addAnnotation(PdfAnnot annotation)
          Adds specified annotation to this PdfPage.
 void addAnnotationList(List annotList)
          Adds specified annotations to the page.
 void addAnnotationList(List annotList, boolean removeExistingAnnots)
          Adds specified annotations to the page and removes existing annotation if specified.
 void addFooterImage(PdfImage img, int position, boolean underlay)
          Adds PdfImage object to footer.
 void addFooterImage(PdfImage img, int position, boolean underlay, boolean scaleToFit, boolean stretch)
           
 void addFooterImage(String path, int position, boolean underlay)
          Adds image, specified by its pathname, to footer.
 void addFooterImage(String path, int position, boolean underlay, boolean scaleToFit, boolean stretch)
           
 void addFooterText(String text, PdfFont font, int position, boolean underlay)
          Adds specified text to footer.
 void addFooterText(String text, PdfFont font, PdfRect rect, int alignment, int firstLinePosition, int position, boolean underlay)
          Adds specified text to footer.
 void addFormField(PdfFormField f)
          Adds specified form field to page.
 void addFormFieldList(List formFieldList)
          Adds specified form fields to the page.
 void addHeaderImage(PdfImage img, int position, boolean underlay)
          Adds PdfImage object to the header.
 void addHeaderImage(PdfImage img, int position, boolean underlay, boolean scaleToFit, boolean stretch)
           
 void addHeaderImage(String path, int position, boolean underlay)
          Adds image, specified by its pathname, to header.
 void addHeaderImage(String path, int position, boolean underlay, boolean scaleToFit, boolean stretch)
           
 void addHeaderText(String text, PdfFont font, int position, boolean underlay)
          Adds specified text to header.
 void addHeaderText(String text, PdfFont font, PdfRect rect, int alignment, int firstLinePosition, int position, boolean underlay)
          Adds specified text to footer.
 void addTable(PdfTable table, double x, double y)
          Adds specified table at position (x, y) on the page.
 void addTable(PdfTable table, PdfFont f, double x, double y)
          Renders specified table with specified font at position (x, y) on the page.
 void addThumbnailImage(String path)
          Adds image with specified pathname as the thumbnail for the page.
 void addWatermarkImage(PdfImage image, int position, boolean applyMargins, double angle, boolean underlay)
          Adds PdfImage object as watermark image with its exact position determined by position and applyMargins.
 void addWatermarkImage(PdfImage image, int position, double angle, boolean underlay)
          Adds PdfImage object as watermark image.
 void addWatermarkImage(String path, int position, boolean applyMargins, double angle, boolean underlay)
          Adds image, specified by its pathname, as watermark image with its exact position determined by position and applyMargins.
 void addWatermarkImage(String path, int position, double angle, boolean underlay)
          Adds image, specified by its pathname, as watermark image.
 void addWatermarkText(String text, PdfFont font, int position, boolean applyMargins, double angle, boolean underlay)
          Adds specified text as watermark with its exact position determined by position and applyMargins.
 void addWatermarkText(String text, PdfFont font, int position, double angle, boolean underlay)
          Adds specified text as watermark.
 void addWatermarkText(String text, PdfFont font, PdfRect rect, int alignment, int firstLinePosition, int position, double angle, boolean underlay)
          Adds specified text as a watermark to a specified rectangular area with specified font, alignment, first-line position, position, rotation, and underlay settings.
 Object clone()
           
 void deleteAnnotations()
          Delete all annotations in the page.
 void deleteAnnotations(int type)
          Delete all annotations of the specified type in the page.
 void deleteFormFields()
          Removes all form fields in the page.
 void deleteFormFields(int type)
          Removes all form fields of specified type in the page.
 void deleteFormFields(String name)
          Removes form fields with specified name in the page.
 void disableAllMargins()
          Disables all margins on this PdfPage.
 void drawArc(PdfRect rect, double startAngle, double sweepAngle)
          Draws an arc.
 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 control point specified by (ctrlX, ctrlY).
 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 control points at (ctrlX1, ctrlY1) and (ctrlX2, ctrlY2).
 void drawBezierCurve(PdfPoint start, PdfPoint control, PdfPoint end, boolean isFill, boolean isStroke)
          Draws a Bézier curve with a single control point.
 void drawBezierCurve(PdfPoint start, PdfPoint controlPoint1, PdfPoint controlPoint2, PdfPoint end, boolean isFill, boolean isStroke)
          Draws a Bézier curve with two control points.
 void drawCircle(double x, double y, double radius, boolean isFill, boolean isStroke)
          Draws a circle with its center at position (x, y).
 void drawCircle(PdfPoint center, double radius, boolean isFill, boolean isStroke)
          Draws a circle with its center at the specified point.
 void drawEllipse(double x1, double y1, double x2, double y2, boolean isFill, boolean isStroke)
          Draws an ellipse whose bounding box has its top-left corner at (x1, y1) and its bottom-right corner at (x2, y2).
 void drawEllipse(PdfPoint p1, PdfPoint p2, boolean isFill, boolean isStroke)
          Draws an ellipse whose bounding box has its top-left corner at point1 and its bottom-right corner at point2.
 void drawImage(PdfImage img, double x, double y)
          Draws specified image at position (x, y).
 void drawImage(PdfImage img, double x, double y, boolean scaleToFit, boolean stretch)
          Draws an image at specified location with specified stretching and aspect ratio settings.
 void drawImage(PdfImage img, double x, double y, double rotation)
          Draws specified image, rotated by rotation degrees, at position (x, y).
 void drawImage(PdfImage img, double x, double y, double rotation, boolean scaleToFit, boolean stretch)
          Draws an image at specified location with specified rotation, stretching and aspect ratio settings.
 void drawImage(PdfImage img, double x, double y, double width, double height)
          Draws specified image at position (x, y) with specified width and height.
 void drawImage(PdfImage img, double x, double y, double width, double height, double rotation)
          Draw specified image, rotated by rotation degrees, at position (x, y) with specified height and width.
 void drawImage(PdfImage img, PdfPoint p)
          Draws specified image at specified point.
 void drawImage(PdfImage img, PdfPoint p, double rotation)
          Draws specified image, rotated by rotation degrees, at point p.
 void drawImage(PdfImage img, PdfPoint p, double width, double height)
          Draws specified image at point p with specified width and height.
 void drawImage(PdfImage img, PdfPoint p, double width, double height, double rotation)
          Draws specified image, rotated by rotation degrees, at point p with specified width and height.
 void drawImage(PdfImage img, PdfRect rect)
          Draws specified image on specified rectangle.
 void drawImage(PdfImage img, PdfRect rect, double rotation)
          Draws specified image, rotated by rotation degrees, on specified rectangle.
 void drawImage(String path, double x, double y)
          Draws image, specified by its pathname, at position (x, y).
 void drawImage(String path, double x, double y, double rotation)
          Draw image, specified by its pathname and rotated by rotation degrees, at position (x, y).
 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.
 void drawImage(String path, double x, double y, double width, double height, double rotation)
          Draws image, specified by its pathname and rotated by rotation degrees, at position (x, y) with specified width and height.
 void drawImage(String path, PdfPoint p)
          Draws image, specified by its pathname, at point p.
 void drawImage(String path, PdfPoint p, double rotation)
          Draws image, specified by its pathname and rotated by rotation degrees, at point p.
 void drawImage(String path, PdfPoint p, double width, double height)
          Draws image, specified by its pathname, at point p with specified width and height.
 void drawImage(String path, PdfPoint p, double width, double height, double rotation)
          Draws image, specified by its pathname and rotated by rotation degrees, at point p with specified width and height.
 void drawImage(String path, PdfRect rect)
          Draws image, specified by its pathname, on rectangle rect.
 void drawImage(String path, PdfRect rect, double rotation)
          Draws image, specified by its pathname and rotated by rotation degrees, on rectangle rect.
 void drawLine(double startx, double starty, double endx, double endy)
          Draws a line between positions (startx, starty) and (endx, endy).
 void drawLine(PdfPoint start, PdfPoint end)
          Draws a line between points start and end.
 void drawPie(double x, double y, double width, double height, double startAngle, double sweepAngle, boolean isFill, boolean isStroke)
          Draws a pie segment.
 void drawPolygon(double[] xPoints, double[] yPoints, int nPoints, boolean isFill, boolean isStroke)
          Draws a polygon.
 void drawPolyline(double[] xPoints, double[] yPoints, int nPoints)
          Draws a polyline.
 void drawRect(double x, double y, double width, double height)
          Draws a rectangle at position (x, y) with specified width and height.
 void drawRect(double x, double y, double width, double height, boolean isFill, boolean isStroke)
          Draws a rectangle at position (x, y) with specified width, height, brush, and pen settings.
 void drawRect(PdfPoint p, double width, double height)
          Draws a rectangle at specified point with specified width and height.
 void drawRect(PdfPoint p, double width, double height, boolean isFill, boolean isStroke)
          Draws a rectangle at specified point with specified width, height, brush, and pen settings.
 void drawRect(PdfRect r)
          Draws a rectangle.
 void drawRect(Rectangle r)
          Draws a rectangle with specified Rectangle object.
 void drawRoundRect(double x, double y, double width, double height, double arcWidth, double arcHeight, boolean isFill, boolean isStroke)
          Draws a rectangle with rounded corners.
 void drawRoundRect(PdfRect rect, double arcWidth, double arcHeight, boolean isFill, boolean isStroke)
          Draws rectangle rect with specified rounded corners.
 void drawSquare(double x, double y, double length)
          Draws a square at position (x, y).
 void drawSquare(double x, double y, double length, boolean isFill, boolean isStroke)
          Draws a square at position (x, y) with specified fill and stroke settings.
 void drawSquare(PdfPoint p, double length)
          Draws a square at point p.
 void drawSquare(PdfPoint p, double length, boolean isFill, boolean isStroke)
          Draws a square at point p with specified fill and stroke settings.
 void enableAllMargins()
          Enables all margins on this PdfPage.
 void enumPageElements(int elementTypes, PdfEnumPageElementsHandler pdfEnumPageElementsHandler)
          Parse all instances of specified page element type(s) and call PdfEnumPageElementsHandler.onEnumPageElements(int, int, PdfPageElement, boolean[]) event handler of the specified class instance.
 List extractText()
          Returns all text content from the page.
 PdfSearchElement findFirst(String searchString, int searchMode, int searchOptions, boolean isSearchForward)
          Searches for specified text in the page and returns the first match.
 PdfSearchElement findNext(PdfSearchElement currentSearchElement)
          Returns the successor of specified search element.
 PdfSearchElement findPrevious(PdfSearchElement currentSearchElement)
          Returns the predecessor of specified search element.
 void flattenFormFields()
          Removes interactivity but retains normal appearance of all form fields in the page.
 void flattenFormFields(boolean flattenWithNewValue)
          Removes interactivity but retains normal appearance of all form fields and also sets run-time values of the form fields if required.
 void flattenFormFields(int type)
          Removes interactivity but retains normal appearance of form fields of specified type in the page.
 void flattenFormFields(int type, boolean flattenWithNewValue)
          Removes interactivity but retains normal appearance of form fields of specified type in the page, and also sets run-time values of the form fields if required.
 void flattenFormFields(String name)
          Removes interactivity but retains normal appearance of form fields with specified name in the page.
 void flattenFormFields(String name, boolean flattenWithNewValue)
          Removes interactivity but retains normal appearance of form fields with specified name in the page, and also sets run-time values of the form fields if required.
 List getAllAnnotations()
          Returns all annotations in the page.
 List getAllAnnotations(int type)
          Returns all annotations of specified type in the page.
 void getAllAnnotations(int type, List listToPopulate)
          Populates specified list with all annotations of specified type in the page.
 void getAllAnnotations(List listToPopulate)
          Populates specified list with all annotations in the page.
 List getAllFontBaseNames()
          Returns base names of all fonts used by the text in the page.
 List getAllFormFields()
          Returns a list of all form fields in the page.
 List getAllFormFields(int type)
          Returns a list of all form fields of specified type in the page.
 List getAllFormFields(String name)
          Returns a list of all form fields with specified name in the page.
 double getBottomMargin()
          Returns size of this page's bottom margin.
 PdfBrush getBrush()
          Returns default brush used on this page.
 int getColorSpace()
          Returns default colorspace of the page.
 double getCropBottom()
          Returns distance between the bottom edge of the page's boundary and the page's crop box.
 double getCropBottom(int unit)
          Returns distance between the bottom edge of the page's boundary and the page's crop box in specified measurement unit.
 PdfRect getCropBox()
          Returns crop box of the page.
 PdfRect getCropBox(int unit)
          Returns crop box of the page in specified measurement unit.
 double getCropBoxHeight()
          Returns height of the crop box of the page.
 double getCropBoxWidth()
          Returns width of the crop box.
 double getCropLeft()
          Returns difference between left boundaries of this page's media box and crop box.
 double getCropLeft(int unit)
          Returns distance between the left edge of the page and the left edge of the page's crop box.
 double getCropRight()
          Returns difference between right boundaries of this page's media box and crop box.
 double getCropRight(int unit)
          Returns distance between the right edge of the page and the right edge of the page's crop box.
 double getCropTop()
          Returns difference between top boundaries of this page's media box and crop box.
 double getCropTop(int unit)
          Returns distance between the top edge of the page and the top edge of the page's crop box.
 double getDisplayDuration()
          Returns number of seconds for which the page presentation effect (transition) specified for this page will take to finish.
 PdfFont getFont()
          Returns default font used to render text elements on this page.
 double getFooterHeight()
          Returns height of this page's footer.
 double getHeaderHeight()
          Returns height of this page's footer.
 double getHeight()
          Returns height of this page.
 double getLeftMargin()
          Returns size of this page's left margin.
 int getMeasurementUnit()
          Returns default measurement unit currently used for this PdfPage.
 PdfRect getMediaBox()
          Returns media box of the page.
 PdfRect getMediaBox(int unit)
          Returns media box of the page in specified measurement unit.
 List getPageElements(int elementTypes)
           
 PdfPen getPen()
          Returns a PdfPen object representing this page's pen.
 PdfPagePresentation getPresentation()
          Returns page presentation effect (transition) set for this page.
 double getRightMargin()
          Returns size of this page's right margin.
 int getRotation()
          Returns angle of rotation for contents of this page.
 PdfTextFormatter getTextFormatter()
          Retrieves PdfTextFormatter object contained by this PdfPage.
 double getTopMargin()
          Returns the size of this page's top margin.
 double getWidth()
          Returns width of this page.
 void redactRegion(PdfRect boundingRect, boolean includeIntersectingText, boolean clipRegion, PdfPen pen, PdfBrush brush, boolean isStroke, boolean isFill)
          Redacts all content in specified region, and fill/stroke the redacted region if specified.
 void redactRegion(PdfRect boundingRect, boolean clipRegion, PdfPen pen, PdfBrush brush, boolean isStroke, boolean isFill)
          Redacts all content in specified region, and fill/stroke the redacted region if specified.
 void redactText(String searchString, int searchMode, int searchOptions)
          Searches for occurrences of specified text string in the page and redacts them.
 void removeThumbnailImage()
          Removes thumbnail image specified for this page.
 void saveAsText(Writer writer)
          Export all text content of the page to specified stream writer instance.
 List search(String searchString, int searchMode, int searchOptions)
          Returns all occurrences of specified text in the page.
 void setBrush(PdfBrush brush)
          Specifies default brush used to stroke PDF elements on the page.
 void setBrushColor(Color c)
          Specifies default color for this page's brush.
 void setColorSpace(int colorspace)
          Specifies default colorspace for the page.
 void setCph(PdfCustomPlaceholderHandler cph)
          Specifies an object of a user class that needs to use custom placholders in text rendered on documents.
 void setCropBottom(double cropBottom)
          Sets position of left edge of the page's crop box.
 void setCropBottom(double cropBottom, int unit)
          Sets the bottom edge of the page's crop box at specified distance from the bottom edge of the page.
 void setCropBox(double cropLeft, double cropTop, double cropRight, double cropBottom)
          Sets crop box of the page at specified positions.
 void setCropBox(double cropLeft, double cropTop, double cropRight, double cropBottom, int unit)
          Sets crop box of the page with specified boundaries in give measurement unit.
 void setCropBox(PdfRect rect)
          Sets specified rectangle as the crop box of the page.
 void setCropBox(PdfRect rect, int unit)
          Sets specified rectangle in specified measurement unit as the crop box of the page.
 void setCropLeft(double cropLeft)
          Sets left edge of the crop box at specified distance from the left edge of the page.
 void setCropLeft(double cropLeft, int unit)
          Sets left edge of the page's crop box at specified distance (in specified measurement unit) from the left edge of the page.
 void setCropRight(double cropRight)
          Sets right edge of the crop box at specified distance from the right edge of the page.
 void setCropRight(double cropRight, int unit)
          Sets right edge of the page's crop box at specified distance (in specified measurement unit) from the right edge of the page.
 void setCropTop(double cropTop)
          Sets top edge of the crop box at specified distance from the top edge of the page.
 void setCropTop(double cropTop, int unit)
          Sets top edge of the crop box at specified distance (in specified measurement unit) from the top edge of the page.
 void setDisplayDuration(double displayDuration)
          Specifies number of seconds for which the page presentation effect (transition) specified for this page needs to take to finish.
 void setFont(PdfFont font)
          Specifies a default font that needs to be used render text elements on this page.
 void setHeight(double height, int unit)
          Sets specified height (in specified measurement unit) for the page.
 void setHeight(double height, int unit, boolean adjustCropBoxSize)
          Sets specified height (in specified measuerment unit) for the page and adjusts the height of the crop box height if specified.
 void setMeasurementUnit(int mu)
          Specifies default measurement unit to be used for this PdfPage.
 void setMediaBox(double left, double top, double width, double height)
          Sets media box of the page with specified dimensions.
 void setMediaBox(double left, double top, double width, double height, int unit)
          Sets media box of the page with specified dimensions (in specified measurement unit).
 void setMediaBox(PdfRect rect)
          Sets media box of the page with specified rectangle.
 void setMediaBox(PdfRect rect, int unit)
          Sets media box of the page with specified rectangle.
 void setPen(PdfPen pen)
          Sets specified PdfPen object as this page's pen.
 void setPenCapStyle(int capStyle)
          Specifies default shape of endpoints of paths in this page.
 void setPenColor(Color color)
          Specifies default color for this page's pen.
 void setPenDashGap(double gap)
          Specifies length of gaps in default dash pattern of this page'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 page's pen.
 void setPenJoinStyle(int joinStyle)
          Specifies default shape of joints of paths that connect at an angle for this pages's pen.
 void setPenMiterLimit(int limit)
          Specifies default miter limit for this page's pen.
 void setPenWidth(double width)
          Specifies default width for this page's pen.
 void setPresentation(PdfPagePresentation presentation)
          Sets specified page presentation effect (transition) for the page.
 void setRotation(int rotation)
          Specifies angle of rotation that viewer applications should apply when displaying contents of this page.
 void setSize(double width, double height, int unit)
          Sets specified width and height (in specified measurement unit) for the page.
 void setSize(double width, double height, int unit, boolean adjustCropBoxSize)
          Sets specified width and height (in specified measurement unit) for the page and proportionally change the dimensions of the crop box if specified.
 void setTextFormatter(PdfTextFormatter tf)
          Specifies new text formatting settings.
 void setWidth(double width, int unit)
          Sets width of the page.
 void setWidth(double width, int unit, boolean adjustCropBoxSize)
          Sets width (in specified measurement unit) of the page and proportionally changes the width of the crop box.
 void writeText(String str)
          Writes specified text on this PdfPage.
 void writeText(String str, boolean wrap)
          Writes text str with specified wrap setting on this PdfPage.
 void writeText(String str, double x, double y)
          Writes text str at position (x, y).
 void writeText(String str, double x, double y, boolean wrap)
          Writes text str at position (x, y) with specified wrap setting.
 void writeText(String str, double x, double y, double rotation)
          Writes text str, rotated by rotation degrees, at position (x, y).
 void writeText(String str, double x, double y, int alignment)
          Writes text str at position (x, y) with specified alignment.
 void writeText(String str, double x, double y, int alignment, boolean wrap)
          Writes str at position (x, y) with specified alignment and wrap setting.
 void writeText(String str, int alignment)
          Writes str with specified alignment.
 void writeText(String str, int alignment, boolean wrap)
          Writes text str with specified alignment and wrap setting.
 void writeText(String str, PdfFont f)
          Writes specified text with specified font.
 void writeText(String str, PdfFont f, boolean wrap)
          Writes text str with specified font and wrap setting.
 void writeText(String str, PdfFont f, double x, double y)
          Writes text str at position (x, y) with specified font.
 void writeText(String str, PdfFont f, double x, double y, boolean wrap)
          Writes text str at position (x, y) with specified font and wrap setting.
 void writeText(String str, PdfFont f, double x, double y, double rotation)
          Writes text str, rotated by rotation degrees, at specified position with specified font.
 void writeText(String str, PdfFont f, int alignment)
          Writes text str with specified font and alignment.
 void writeText(String str, PdfFont f, int alignment, boolean wrap)
          Writes text str with specified font, alignment, and wrap setting.
 void writeText(String str, PdfFont f, int alignment, double x, double y)
          Writes text str at position (x, y) with specified font and alignement
 void writeText(String str, PdfFont f, int alignment, double x, double y, boolean wrap)
          Writes text str at position (x, y) with specified font, alignment, and wrap setting.
 void writeText(String str, PdfFont f, int alignment, PdfPoint p)
          Writes text str with specified font and alignment at specified point.
 void writeText(String str, PdfFont f, int alignment, PdfPoint p, boolean wrap)
          Writes text str with specified font, alignment, and wrap setting at specified point.
 void writeText(String str, PdfFont f, PdfPoint p)
          Writes text str with specified font at specified point.
 void writeText(String str, PdfFont f, PdfPoint p, boolean wrap)
          Writes text str with specified font and wrap setting at specified point.
 void writeText(String str, PdfFont f, PdfPoint p, double rotation)
          Writes text str, rotated by rotation degrees, at specified point with specified font.
 void writeText(String str, PdfFont f, PdfRect rect)
          Writes text str with specified font inside specified rectangle.
 void writeText(String str, PdfFont f, PdfRect rect, double rotation, double firstLinePosition)
          Writes text str, rotated by rotation degrees, with specified font and first-line position inside specified rectangle.
 void writeText(String str, PdfFont f, PdfRect rect, int alignment)
          Writes text str with specified font and alignment inside specified rectangle.
 void writeText(String str, PdfFont f, PdfRect rect, int alignment, double rotation, double firstLinePosition)
          Writes text str, rotated by rotation degrees, with specified font, alignment, and first-line position inside specified rectangle.
 void writeText(String str, PdfPoint p)
          Writes specified text at specified point.
 void writeText(String str, PdfPoint p, boolean wrap)
          Writes text str with specified wrap setting at specified point.
 void writeText(String str, PdfPoint p, double rotation)
          Writes text str, rotated by rotation degrees, at specified point.
 void writeText(String str, PdfPoint p, int alignment)
          Writes text str with specified alignment at specified point.
 void writeText(String str, PdfPoint p, int alignment, boolean wrap)
          Writes text str with specified alignment and wrap setting at specified point.
 void writeText(String str, PdfRect rect)
          Writes specified text inside specified rectanlge.
 void writeText(String str, PdfRect rect, double rotation, double firstLinePosition)
          Writes text str, rotated by rotation degrees, with specified first-line position inside specified rectangle.
 void writeText(String str, PdfRect rect, int alignment)
          Writes text str with specified alignment inside specified rectangle.
 void writeText(String str, PdfRect rect, int alignment, double rotation, double firstLinePosition)
          Writes text str, rotated by rotation degrees, with specified alignment and first-line position inside specified rectangle.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HP_LEFT

public static final int HP_LEFT
Constant to specify horizontal alignment to the left (inside header, footer and watermarks)

See Also:
Constant Field Values

HP_MIDDLE

public static final int HP_MIDDLE
Constant to specify horizontal alignment to the middle (inside header, footer and watermarks)

See Also:
Constant Field Values

HP_RIGHT

public static final int HP_RIGHT
Constant to specify horizontal alignment to the right (inside header, footer and watermarks)

See Also:
Constant Field Values

VP_TOP

public static final int VP_TOP
Constant to specify vertical alignment to the top (inside header, footer and watermarks)

See Also:
Constant Field Values

VP_CENTRE

public static final int VP_CENTRE
Constant to specify vertical alignment to the center (inside header, footer and watermarks)

See Also:
Constant Field Values

VP_BOTTOM

public static final int VP_BOTTOM
Constant to specify vertical alignment to the bottom (inside header, footer and watermarks)

See Also:
Constant Field Values

UNDERLAY

public static final boolean UNDERLAY
Constant to specify z-order underlay

See Also:
Constant Field Values

OVERLAY

public static final boolean OVERLAY
Constant to specify z-order overlay

See Also:
Constant Field Values

COLORSPACE_RGB

public static final int COLORSPACE_RGB
Constant specifing RGB (Red-Green-Blue) colorspace.

See Also:
Constant Field Values

COLORSPACE_CMYK

public static final int COLORSPACE_CMYK
Constant specifying CMYK (Cyan-Magenta-Yellow-blacK) colorspace.

See Also:
Constant Field Values
Constructor Detail

PdfPage

public PdfPage()
Zero-argument default constructor.

Sample Code
See example.

PdfPage

public PdfPage(int pageSize)
Constructs a page with specified size.

Parameters:
pageSize - constant specifying the page size
See Also:
PdfPageSize
Sample Code
See example.

PdfPage

public PdfPage(double width,
               double height)
Constructs a page with specified width and height.

Parameters:
width - width of the page
height - height of page
Sample Code
See example.

PdfPage

public PdfPage(double width,
               double height,
               int measurementUnit)
Constructs a page with specified width and height (in specified measurement unit).

Parameters:
width - width of the page
height - height of the page
measurementUnit - constant specifying the measurement unit

PdfPage

public PdfPage(int pageSize,
               double pageLeftMargin,
               double pageTopMargin,
               double pageRightMargin,
               double pageBottomMargin,
               int measurementUnit)
Constructs a page with specified size and margins (in specified measurement unit).

Parameters:
pageSize - constant specifying the page size
pageLeftMargin - size of the left margin
pageTopMargin - size of the top margin
pageRightMargin - size of the right margin
pageBottomMargin - size of the bottom margin
measurementUnit - constant specifying the measurement unit
See Also:
PdfPageSize, PdfMeasurement
Sample Code
See example.

PdfPage

public PdfPage(double width,
               double height,
               double pageLeftMargin,
               double pageTopMargin,
               double pageRightMargin,
               double pageBottomMargin,
               int measurementUnit)
Constructs a page with specified width, height, and margins (in specified measurement unit).

Parameters:
width - width of the page
height - height of the page
pageLeftMargin - size of the left margin
pageTopMargin - size of the top margin
pageRightMargin - size of the right margin
pageBottomMargin - size of the bottom margin
measurementUnit - constant specifying the measurement unit
See Also:
PdfMeasurement
Sample Code
See example.

PdfPage

public PdfPage(int pageSize,
               double pageHeaderHeight,
               double pageFooterHeight,
               double pageLeftMargin,
               double pageTopMargin,
               double pageRightMargin,
               double pageBottomMargin,
               int measurementUnit)
Constructs a page with specified size, header height, footer height, and margins (in specified measurement unit).

Parameters:
pageSize - constant specifying the page size
pageHeaderHeight - height of the header
pageFooterHeight - height of the footer
pageLeftMargin - size of the left margin
pageTopMargin - size of the top margin
pageRightMargin - size of the right margin
pageBottomMargin - size of the bottom margin
measurementUnit - constant specifying the measurement unit
See Also:
PdfPageSize, PdfMeasurement
Sample Code
See example.

PdfPage

public PdfPage(double width,
               double height,
               double pageHeaderHeight,
               double pageFooterHeight,
               double pageLeftMargin,
               double pageTopMargin,
               double pageRightMargin,
               double pageBottomMargin,
               int measurementUnit)
Constructs a page with its width, height, header height, footer height, and margins specified in specified unit.

Parameters:
width - width of the page
height - height of the page
pageHeaderHeight - height of the header
pageFooterHeight - height of the footer
pageLeftMargin - size of the left margin
pageTopMargin - size of the top margin
pageRightMargin - size of the right margin
pageBottomMargin - size of the bottom margin
measurementUnit - constant specifying the measurement unit
See Also:
PdfMeasurement
Sample Code
See example.
Method Detail

clone

public Object clone()

getDisplayDuration

public double getDisplayDuration()
Returns number of seconds for which the page presentation effect (transition) specified for this page will take to finish.

Returns:
number of seconds
See Also:
PdfProPage.setDisplayDuration(double), PdfPagePresentation

setDisplayDuration

public void setDisplayDuration(double displayDuration)
Specifies number of seconds for which the page presentation effect (transition) specified for this page needs to take to finish.

Parameters:
displayDuration - number of seconds
See Also:
PdfProPage.getDisplayDuration(), PdfPagePresentation

getPresentation

public PdfPagePresentation getPresentation()
Returns page presentation effect (transition) set for this page.

Returns:
page presentation effect (transition) set for this page.
See Also:
PdfProPage.setPresentation(PdfPagePresentation), PdfPagePresentation

getAllFontBaseNames

public List getAllFontBaseNames()
                         throws IOException,
                                PdfException
Returns base names of all fonts used by the text in the page.

Returns:
list containing the base names
Throws:
IOException - if an I/O error occurs.
PdfException - if an error occurs in the method.

setPresentation

public void setPresentation(PdfPagePresentation presentation)
Sets specified page presentation effect (transition) for the page.

Parameters:
presentation - page presentation effect that the page needs to display in viewer applications
See Also:
PdfProPage.getPresentation(), PdfPagePresentation

addTable

public void addTable(PdfTable table,
                     double x,
                     double y)
              throws PdfException,
                     IOException
Adds specified table at position (x, y) on the page.

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

addTable

public void addTable(PdfTable table,
                     PdfFont f,
                     double x,
                     double y)
              throws PdfException,
                     IOException
Renders specified table with specified font at position (x, y) on the page.

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

setWidth

public void setWidth(double width,
                     int unit)
              throws PdfException,
                     IOException
Sets width of the page.

Parameters:
width - width of the page
unit - measurement unit in which the width is specified
Throws:
IOException
PdfException
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
See Also:
PdfMeasurement

setWidth

public void setWidth(double width,
                     int unit,
                     boolean adjustCropBoxSize)
              throws PdfException,
                     IOException
Sets width (in specified measurement unit) of the page and proportionally changes the width of the crop box.

Parameters:
width - width of the page
unit - measurement unit with which the width is specified
adjustCropBoxSize - whether the width of the crop box will also be proportionally changed
Throws:
IOException
PdfException

setHeight

public void setHeight(double height,
                      int unit)
               throws IOException,
                      PdfException
Sets specified height (in specified measurement unit) for the page.

Parameters:
height - height of the page
unit - measurement unit in which the height is specified
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
See Also:
PdfMeasurement

setHeight

public void setHeight(double height,
                      int unit,
                      boolean adjustCropBoxSize)
               throws IOException,
                      PdfException
Sets specified height (in specified measuerment unit) for the page and adjusts the height of the crop box height if specified.

Parameters:
height - height of the page
unit - measurement unit with which the height is specified
adjustCropBoxSize - whether the crop box size needs to proportionally adjusted to suit the new height
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.

setSize

public void setSize(double width,
                    double height,
                    int unit)
             throws IOException,
                    PdfException
Sets specified width and height (in specified measurement unit) for the page.

Parameters:
width - width of the page
height - height of the page
unit - measurement unit with which width and height are specified
Throws:
IOException - if an I/O error occurred.
PdfException - if an illegal argument is supplied.

setSize

public void setSize(double width,
                    double height,
                    int unit,
                    boolean adjustCropBoxSize)
             throws IOException,
                    PdfException
Sets specified width and height (in specified measurement unit) for the page and proportionally change the dimensions of the crop box if specified.

Parameters:
width - width of the page
height - height of the page
unit - measurement unit of the page
adjustCropBoxSize - whether the dimensions of the crop box needs to be proportionally adjusted with the new dimensions of the page
Throws:
IOException - if an I/O error occurred
PdfException - if an illegal argument is supplied.

flattenFormFields

public void flattenFormFields(boolean flattenWithNewValue)
                       throws IOException,
                              PdfException
Removes interactivity but retains normal appearance of all form fields and also sets run-time values of the form fields if required.

Parameters:
flattenWithNewValue - whether run-time values need to be set to the form fields before they are flattened
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.

flattenFormFields

public void flattenFormFields(int type,
                              boolean flattenWithNewValue)
                       throws IOException,
                              PdfException
Removes interactivity but retains normal appearance of form fields of specified type in the page, and also sets run-time values of the form fields if required.

Parameters:
type - constant specifying type of form field
flattenWithNewValue - whether run-time values need to be set to the form fields before they are flattened
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
Removes interactivity but retains normal appearance of form fields with specified name in the page, and also sets run-time values of the form fields if required.

Parameters:
name - name of the form fields that need to be removed
flattenWithNewValue - whether run-time values need to be set to the form fields before they are flattened
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.

flattenFormFields

public void flattenFormFields()
                       throws IOException,
                              PdfException
Removes interactivity but retains normal appearance of all form fields in the page.

Throws:
IOException - if an I/O error occurs.
PdfException - if an error occurs in the method.

flattenFormFields

public void flattenFormFields(int type)
                       throws IOException,
                              PdfException
Removes interactivity but retains normal appearance of form fields of specified type in the page.

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

flattenFormFields

public void flattenFormFields(String name)
                       throws IOException,
                              PdfException
Removes interactivity but retains normal appearance of form fields with specified name in the page.

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

deleteFormFields

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

Throws:
IOException - if an I/O error occurs.
PdfException - if an error occurs while deleting the form fields

deleteFormFields

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

Parameters:
type - constant specifying type of form field
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 form fields with specified name in the page.

Parameters:
name - name of the form fields that need to be removed
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 specified list with all annotations in the page.

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

getAllAnnotations

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

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

getAllAnnotations

public List getAllAnnotations(int type)
                       throws PdfException,
                              IOException
Returns all annotations of specified type in the page.

Parameters:
type - constant specifying type of the annotations
Returns:
list containing the annotations
Throws:
PdfException - if called in creation mode or if an illegal argument is supplied.
IOException - if an I/O error occurs.

getAllAnnotations

public List getAllAnnotations()
                       throws PdfException,
                              IOException
Returns all annotations in the page.

Returns:
list containing the annotations
Throws:
PdfException - if an error occurs in the method.
IOException - if an I/O error occurs.

getAllFormFields

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

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

getAllFormFields

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

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

getAllFormFields

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

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

addAnnotation

public void addAnnotation(PdfAnnot annotation)
                   throws PdfException
Description copied from class: com.gnostice.pdfone.PdfStdPage
Adds specified annotation to this PdfPage.

Parameters:
annotation - annotation that needs to be added
Throws:
PdfException - if an illegal argument is supplied.

addAnnotationList

public void addAnnotationList(List annotList)
                       throws PdfException
Adds specified annotations to the page.

Parameters:
annotList - annotations that need to be added to the page
Throws:
PdfException - if an illegal argument is supplied.

addAnnotationList

public void addAnnotationList(List annotList,
                              boolean removeExistingAnnots)
                       throws PdfException
Adds specified annotations to the page and removes existing annotation if specified.

Parameters:
annotList - annotations that need to be added to the page
removeExistingAnnots - whether annotations that already exist in the page need to be removed
Throws:
PdfException - if an illegal argument is supplied.

addFormField

public void addFormField(PdfFormField f)
Adds specified form field to page.

Parameters:
f - form field that needs to be added to the page

addFormFieldList

public void addFormFieldList(List formFieldList)
Adds specified form fields to the page.

Parameters:
formFieldList - form fields that need to be added to the page

addThumbnailImage

public void addThumbnailImage(String path)
                       throws IOException,
                              PdfException
Adds image with specified pathname as the thumbnail for the page.

Parameters:
path - pathname of the image
Throws:
IOException - if an I/O error occurred.
PdfException - if an illegal argument is supplied.

removeThumbnailImage

public void removeThumbnailImage()
Removes thumbnail image specified for this page.


deleteAnnotations

public void deleteAnnotations()
                       throws PdfException,
                              IOException
Delete all annotations in the page.

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

deleteAnnotations

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

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

getPageElements

public List getPageElements(int elementTypes)
                     throws PdfException,
                            IOException
Throws:
PdfException
IOException

enumPageElements

public void enumPageElements(int elementTypes,
                             PdfEnumPageElementsHandler pdfEnumPageElementsHandler)
                      throws PdfException,
                             IOException
Parse all instances of specified page element type(s) and call PdfEnumPageElementsHandler.onEnumPageElements(int, int, PdfPageElement, boolean[]) event handler of the specified class instance.

Parameters:
elementTypes - constant specifying PdfPageElement.ELEMENT_TYPE_ALL
pdfEnumPageElementsHandler - class instance whose event handler needs to be called
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.

search

public List search(String searchString,
                   int searchMode,
                   int searchOptions)
            throws PdfException,
                   IOException
Returns all occurrences of specified text in the page.

Parameters:
searchString - text that whose occurrences need to be found
searchMode - constant specifying whether the search string is a literal text or a regular expression
searchOptions - constant specifying text search options
Returns:
list of all text matches
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.

findFirst

public PdfSearchElement findFirst(String searchString,
                                  int searchMode,
                                  int searchOptions,
                                  boolean isSearchForward)
                           throws PdfException,
                                  IOException
Searches for specified text in the page and returns the first match.

Parameters:
searchString - text whose occurrences need to be searched in the page
searchMode - constant specifying whether the search string is a literal text or a regular expression
searchOptions - constant specifying text search options
isSearchForward - true if search should move towards the end of the document; false if search should be performed in the reverse direction
Returns:
first page element that matched the search
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.

findNext

public PdfSearchElement findNext(PdfSearchElement currentSearchElement)
                          throws PdfException,
                                 IOException
Returns the successor of specified search element.

Parameters:
currentSearchElement - page element search result whose successor needs to be found
Returns:
successor of specified search element
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 the predecessor of specified search element.

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

redactRegion

public void redactRegion(PdfRect boundingRect,
                         boolean clipRegion,
                         PdfPen pen,
                         PdfBrush brush,
                         boolean isStroke,
                         boolean isFill)
                  throws PdfException,
                         IOException
Redacts all content in specified region, and fill/stroke the redacted region if specified.

Parameters:
boundingRect - region in the page that needs to be redacted
clipRegion -
pen - pen used to stroke the region
brush - brush used to stroke the region
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(PdfRect boundingRect,
                         boolean includeIntersectingText,
                         boolean clipRegion,
                         PdfPen pen,
                         PdfBrush brush,
                         boolean isStroke,
                         boolean isFill)
                  throws PdfException,
                         IOException
Redacts all content in specified region, and fill/stroke the redacted region if specified.

Parameters:
boundingRect - region in the page that needs to be redacted
includeIntersectingText - whether page elements that only appear partially within the region
clipRegion -
pen - pen used to stroke the region
brush - brush used to stroke the region
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(String searchString,
                       int searchMode,
                       int searchOptions)
                throws PdfException,
                       IOException
Searches for occurrences of specified text string in the page and redacts them.

Parameters:
searchString - text whose occurrences need to be redacted
searchMode - constant specifying whether the search string is a literal text or a regular expression
searchOptions - constant specifying text search options
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.

extractText

public List extractText()
                 throws PdfException,
                        IOException
Returns all text content from the page.

Returns:
a list containing lines of text from the page
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.

saveAsText

public void saveAsText(Writer writer)
                throws PdfException,
                       IOException
Export all text content of the page to specified stream writer instance.

Parameters:
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.

setMeasurementUnit

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

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

getMeasurementUnit

public int getMeasurementUnit()
Returns default measurement unit currently used for this PdfPage.

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

setPenWidth

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

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

setPenColor

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

Parameters:
color - default color for the page'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:
PdfStdPage.setPenDashGap(double), PdfStdPage.setPenDashPhase(double)
Sample Code
See example.

setPenDashGap

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

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

setPenDashPhase

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

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

setPenCapStyle

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

Parameters:
capStyle - constant specifying the default shape
Since:
1.0
See Also:
PdfPen
Sample Code
See example.

setPenJoinStyle

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

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

setPenMiterLimit

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

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

setBrushColor

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

Parameters:
c - default color for the page's brush
Since:
1.0
Sample Code
See example.

getTextFormatter

public PdfTextFormatter getTextFormatter()
Retrieves PdfTextFormatter object contained by this PdfPage.

Returns:
PdfTextFormatter object contained by the PdfPage
Since:
1.0
See Also:
PdfStdPage.setTextFormatter(PdfTextFormatter)
Sample Code
See example.

setTextFormatter

public void setTextFormatter(PdfTextFormatter tf)
Specifies new text formatting settings.

Parameters:
tf - new text formatting settings
Since:
1.0
See Also:
PdfStdPage.getTextFormatter()
Sample Code
See example.

disableAllMargins

public void disableAllMargins()
Disables all margins on this PdfPage.

Since:
1.0
See Also:
PdfStdPage.enableAllMargins()
Sample Code
See example.

enableAllMargins

public void enableAllMargins()
Enables all margins on this PdfPage.

Since:
1.0
See Also:
PdfStdPage.disableAllMargins()
Sample Code
See example.

getBottomMargin

public double getBottomMargin()
Returns size of this page's bottom margin.

Returns:
(expressed in points) size of the bottom margin
Since:
1.0

getFooterHeight

public double getFooterHeight()
Returns height of this page's footer.

Returns:
(expressed in points) height of the footer
Since:
1.0

getHeaderHeight

public double getHeaderHeight()
Returns height of this page's footer.

Returns:
(expressed in points) height of the footer
Since:
1.0

getLeftMargin

public double getLeftMargin()
Returns size of this page's left margin.

Returns:
(expressed in points) size of the left margin
Since:

getRightMargin

public double getRightMargin()
Returns size of this page's right margin.

Returns:
(expressed in points) size of the right margin
Since:
1.0

getTopMargin

public double getTopMargin()
Returns the size of this page's top margin.

Returns:
(expressed in points) size of the top margin
Since:
1.0

getBrush

public PdfBrush getBrush()
Returns default brush used on this page.

Returns:
default brush of the page
Since:
1.0

setBrush

public void setBrush(PdfBrush brush)
Specifies default brush used to stroke PDF elements on the page.

Parameters:
brush - default brush
See Also:
PdfStdPage.getBrush(), PdfStdPage.setPen(PdfPen), #setPenBrush(boolean, boolean)

getCropBottom

public double getCropBottom()
Returns distance between the bottom edge of the page's boundary and the page's crop box.

Returns:
(expressed in points) distance between the bottom edge of the page's boundary and the page's crop box.

getCropBottom

public double getCropBottom(int unit)
Returns distance between the bottom edge of the page's boundary and the page's crop box in specified measurement unit.

Parameters:
unit - measurement unit with which distance is returned
Returns:
distance between the bottom edge of the page's boundary and the page's crop box

setCropBottom

public void setCropBottom(double cropBottom)
Sets position of left edge of the page's crop box.

Parameters:
cropBottom - distance between the left edge of the page and left edge of the page's crop box

setCropBottom

public void setCropBottom(double cropBottom,
                          int unit)
Sets the bottom edge of the page's crop box at specified distance from the bottom edge of the page.

Parameters:
cropBottom - distance between the bottom edge of the page and the bottom edge of the page's crop box
unit - measurement unit with which the distance is specified

getCropLeft

public double getCropLeft()
Returns difference between left boundaries of this page's media box and crop box.

Returns:
(expressed in points) difference between left boundaries of this page's media box and crop box
Since:
1.0

getCropLeft

public double getCropLeft(int unit)
Returns distance between the left edge of the page and the left edge of the page's crop box.

Parameters:
unit - measurement unit with which distance needs to be specified
Returns:
distance between the left edge of the page and the left edge of the page's crop box

setCropLeft

public void setCropLeft(double cropLeft)
Sets left edge of the crop box at specified distance from the left edge of the page.

Parameters:
cropLeft - distance between from the left edge of the crop box and the left edge of the page

setCropLeft

public void setCropLeft(double cropLeft,
                        int unit)
Sets left edge of the page's crop box at specified distance (in specified measurement unit) from the left edge of the page.

Parameters:
cropLeft - distance between the left edge of the page and the page's crop box
unit - measurement unit with which the distance is specified

getCropRight

public double getCropRight()
Returns difference between right boundaries of this page's media box and crop box.

Returns:
(expressed in points) difference between right boundaries of this page's media box and crop box
Since:
1.0

getCropRight

public double getCropRight(int unit)
Returns distance between the right edge of the page and the right edge of the page's crop box.

Parameters:
unit - measurement unit with which distance needs to be specified
Returns:
distance between the right edge of the page and the right edge of the page's crop box

setCropRight

public void setCropRight(double cropRight)
Sets right edge of the crop box at specified distance from the right edge of the page.

Parameters:
cropRight - distance between from the right edge of the crop box and the right edge of the page

setCropRight

public void setCropRight(double cropRight,
                         int unit)
Sets right edge of the page's crop box at specified distance (in specified measurement unit) from the right edge of the page.

Parameters:
cropRight - distance between the right edge of the page and the right edge of the page's crop box
unit - measurement unit with which the distance is specified

getCropTop

public double getCropTop()
Returns difference between top boundaries of this page's media box and crop box.

Returns:
(expressed in points) difference between top boundaries of this page's media box and crop box.
Since:
1.0

getCropTop

public double getCropTop(int unit)
Returns distance between the top edge of the page and the top edge of the page's crop box.

Parameters:
unit - measurement unit with which distance needs to be specified
Returns:
distance between the top edge of the page and the top edge of the page's crop box

setCropTop

public void setCropTop(double cropTop)
Sets top edge of the crop box at specified distance from the top edge of the page.

Parameters:
cropTop - distance between from the top edge of the crop box and the top edge of the page

setCropTop

public void setCropTop(double cropTop,
                       int unit)
Sets top edge of the crop box at specified distance (in specified measurement unit) from the top edge of the page.

Parameters:
cropTop - distance between from the top edge of the crop box and the top edge of the page
unit - measurement unit with which the distance is specified

setCropBox

public void setCropBox(double cropLeft,
                       double cropTop,
                       double cropRight,
                       double cropBottom)
Sets crop box of the page at specified positions.

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

setCropBox

public void setCropBox(double cropLeft,
                       double cropTop,
                       double cropRight,
                       double cropBottom,
                       int unit)
Sets crop box of the page with specified boundaries in give 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 boundaries are specified

setCropBox

public void setCropBox(PdfRect rect)
                throws PdfException
Sets specified rectangle as the crop box of the page.

Parameters:
rect - rectangular area on the page that needs to be set as the crop box
Throws:
PdfException - if an illegal argument is supplied

setCropBox

public void setCropBox(PdfRect rect,
                       int unit)
                throws PdfException
Sets specified rectangle in specified measurement unit as the crop box of the page.

Parameters:
rect - rectangular area on the page that needs to be set as the crop box
unit - measurement unit with which the rectangle is specified
Throws:
PdfException - if an illegal argument is supplied.

getCropBox

public PdfRect getCropBox()
Returns crop box of the page.

Returns:
crop box of the page.

getCropBox

public PdfRect getCropBox(int unit)
Returns crop box of the page in specified measurement unit.

Parameters:
unit - measurement unit with which the crop box needs to be specified
Returns:
crop box of the page

setMediaBox

public void setMediaBox(double left,
                        double top,
                        double width,
                        double height)
Sets media box of the page with specified dimensions.

Parameters:
left - x-coorinate of the top-left corner of the media box
top - y-coorinate of the top-left corner of the media box
width - width of the media box
height - height of the media box

setMediaBox

public void setMediaBox(double left,
                        double top,
                        double width,
                        double height,
                        int unit)
Sets media box of the page with specified dimensions (in specified measurement unit).

Parameters:
left - x-coorinate of the top-left corner of the media box
top - y y-coorinate of the top-left corner of the media box
width - width of the media box
height - height of the media box
unit - measurement unit used to specify the media box

setMediaBox

public void setMediaBox(PdfRect rect)
                 throws PdfException
Sets media box of the page with specified rectangle.

Parameters:
rect - rectangular area on the page that needs to be used as the media box
Throws:
PdfException - if an illegal argument is supplied

setMediaBox

public void setMediaBox(PdfRect rect,
                        int unit)
                 throws PdfException
Sets media box of the page with specified rectangle.

Parameters:
rect - rectangular area on the page that needs to be set as the media box
unit - measurement unit with which the rectangle is specified
Throws:
PdfException - if an illegal argument is supplied

getMediaBox

public PdfRect getMediaBox()
Returns media box of the page.

Returns:
media box of the page

getMediaBox

public PdfRect getMediaBox(int unit)
Returns media box of the page in specified measurement unit.

Parameters:
unit - measurement unit with which the crop box needs to be specified
Returns:
media box of the page

getHeight

public double getHeight()
Returns height of this page.

Returns:
(expressed in points) height of the page
Since:
1.0

getCropBoxHeight

public double getCropBoxHeight()
Returns height of the crop box of the page.

Returns:
height of the crop box of the page

getWidth

public double getWidth()
Returns width of this page.

Returns:
(expressed in points) width of the page
Since:
1.0

getCropBoxWidth

public double getCropBoxWidth()
Returns width of the crop box.

Returns:
width of the crop box

getPen

public PdfPen getPen()
Returns a PdfPen object representing this page's pen.

Returns:
a PdfPen object representing the page's pen.
Since:
1.0
See Also:
PdfStdPage.setPen(PdfPen)
Sample Code
See example.

setPen

public void setPen(PdfPen pen)
Sets specified PdfPen object as this page's pen.

Parameters:
pen - PdfPen object to be set as this page's pen
Since:
1.0
See Also:
PdfStdPage.getPen()
Sample Code
See example.

setFont

public void setFont(PdfFont font)
             throws PdfException
Specifies a default font that needs to be used render text elements on this page. If no default font is specified, Helvetica 10 pt. will be used.

Parameters:
font - default font that needs to render text elements on this page
Throws:
PdfException
See Also:
PdfStdPage.getFont()

getRotation

public int getRotation()
Returns angle of rotation for contents of this page. The angle of rotation will be expressed in integer multiples of 90 degrees.

Returns:
(expressed in integer multiples of 90 degrees and measured in counterclockwise direction) angle of rotation for contents of the page
Since:
1.0

setRotation

public void setRotation(int rotation)
                 throws PdfException
Specifies angle of rotation that viewer applications should apply when displaying contents of this page.

Parameters:
rotation - angle of rotation (needs to be a multiple of 90 degrees)
Throws:
PdfException - if an illegal argument is supplied.

setCph

public void setCph(PdfCustomPlaceholderHandler cph)
Specifies an object of a user class that needs to use custom placholders in text rendered on documents.

Parameters:
cph - an object of a class that implements PdfCustomPlaceholderHandler class

setColorSpace

public void setColorSpace(int colorspace)
                   throws PdfException
Specifies default colorspace for the page.

Parameters:
colorspace - constant specifying the default colorspace (either PdfStdPage.COLORSPACE_CMYK or PdfStdPage.COLORSPACE_RGB
Throws:
PdfException
See Also:
PdfStdPage.getColorSpace()

getColorSpace

public int getColorSpace()
Returns default colorspace of the page.

Returns:
constant specifying the colorspace (either PdfStdPage.COLORSPACE_CMYK or PdfStdPage.COLORSPACE_RGB
See Also:
PdfStdPage.setColorSpace(int)

addAction

public void addAction(int event,
                      int actionType,
                      String javascriptOrURI)
               throws PdfException
Adds action of resolving specified Uniform Resource Identifier URI) or executing a JavaScript script for the specified event.

Parameters:
event - constant specifying trigger event for executing the action
actionType - constant specifying resolution of URI or execution of JavaScript script
javascriptOrURI - specified URI or Javascript script
Throws:
PdfException - if an illegal argument is supplied.
Since:
1.0
See Also:
PdfAction, PdfAction.PdfEvent
Sample Code
See example.

addAction

public void addAction(int event,
                      int actionType,
                      String applicationToLaunch,
                      boolean isPrint)
               throws PdfException
Adds action of launching specified application, or displaying or printing specified file for the specified event.

Parameters:
event - constant specifying the trigger event for executing the named action
actionType - constant specifying action of launching an application, or displaying or printing a file
applicationToLaunch - pathname of the application that needs to be launched or the file that needs to be displayed or printed
isPrint - whether to file needs to be printed instead of being displayed
Throws:
PdfException - if an illegal argument is supplied.
Since:
1.0
See Also:
PdfAction, PdfAction.PdfEvent
Sample Code
See example.

addAction

public void addAction(int event,
                      int namedAction)
               throws PdfException
Adds specified named action for specified trigger event.

Parameters:
event - constant specifying the trigger event for executing the named action
namedAction - constant specifying the named action that needs to be executed when the trigger event occurs
Throws:
PdfException - if an illegal argument is supplied.
Since:
1.0
See Also:
PdfAction, PdfAction.PdfEvent
Sample Code
See example.

addWatermarkText

public void addWatermarkText(String text,
                             PdfFont font,
                             int position,
                             boolean applyMargins,
                             double angle,
                             boolean underlay)
                      throws IOException,
                             PdfException
Adds specified text as watermark with its exact position determined by position and applyMargins.

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
applyMargins - 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
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)
                      throws IOException,
                             PdfException
Adds specified text as 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
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
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)
                      throws IOException,
                             PdfException
Adds specified text as a watermark to a specified rectangular area with specified font, alignment, first-line position, position, rotation, and underlay settings.

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
rect - rectangular area where the 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
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,
                              boolean applyMargins,
                              double angle,
                              boolean underlay)
                       throws IOException,
                              PdfException
Adds PdfImage object as watermark image with its exact position determined by position and applyMargins.

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
applyMargins - 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
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)
                       throws IOException,
                              PdfException
Adds PdfImage object as watermark image.

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
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 applyMargins,
                              double angle,
                              boolean underlay)
                       throws IOException,
                              PdfException
Adds image, specified by its pathname, as watermark image with its exact position determined by position and applyMargins.

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
applyMargins - 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
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)
                       throws IOException,
                              PdfException
Adds image, specified by its pathname, as watermark image.

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
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)
                   throws IOException,
                          PdfException
Adds specified text to header.

Parameters:
text - text that needs to be added to the header
font - font with which the text needs to be written
position - constant specifying the combination of vertical and horizontal alignment of the text within the header
underlay - whether the text needs to be placed underneath other content in the header
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)
                   throws IOException,
                          PdfException
Adds specified text to footer.

Parameters:
text - text that needs to be added to the footer
font - font with which the text next needs to be written
rect - rect in which the text needs to be embeded
alignment - alignment of the text embeded inside the rect
firstLinePosition - firstLinePosition of the text inside rect
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
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(PdfImage img,
                           int position,
                           boolean underlay)
                    throws IOException,
                           PdfException
Adds PdfImage object to 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
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,
                           boolean scaleToFit,
                           boolean stretch)
                    throws IOException,
                           PdfException
Throws:
IOException
PdfException

addHeaderImage

public void addHeaderImage(PdfImage img,
                           int position,
                           boolean underlay,
                           boolean scaleToFit,
                           boolean stretch)
                    throws IOException,
                           PdfException
Throws:
IOException
PdfException

addHeaderImage

public void addHeaderImage(String path,
                           int position,
                           boolean underlay)
                    throws IOException,
                           PdfException
Adds image, specified by its pathname, to header.

Parameters:
path - pathname of the image, which 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
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)
                   throws IOException,
                          PdfException
Adds specified text to footer.

Parameters:
text - text that needs 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
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)
                   throws IOException,
                          PdfException
Adds specified text to footer.

Parameters:
text - text that needs to be added to the footer
font - font with which the text next needs to be written
rect - rect in which the text needs to be embeded
alignment - alignment of the text embeded inside the rect
firstLinePosition - firstLinePosition of the text inside rect
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
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(PdfImage img,
                           int position,
                           boolean underlay)
                    throws IOException,
                           PdfException
Adds PdfImage object to footer.

Parameters:
img - PdfImage object that needs to be added to the footer
position - constant specifying the 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
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,
                           boolean scaleToFit,
                           boolean stretch)
                    throws IOException,
                           PdfException
Throws:
IOException
PdfException

addFooterImage

public void addFooterImage(PdfImage img,
                           int position,
                           boolean underlay,
                           boolean scaleToFit,
                           boolean stretch)
                    throws IOException,
                           PdfException
Throws:
IOException
PdfException

addFooterImage

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

Parameters:
path - pathname of the image, which needs to be added to the footer
position - constant specifying the 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
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 IOException,
                      PdfException
Writes specified text on this PdfPage.

Parameters:
str - text that 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,
                      int alignment,
                      boolean wrap)
               throws IOException,
                      PdfException
Writes text str with specified alignment and wrap setting.

Parameters:
str - text that needs to be written
alignment - constant specifying how the text needs to be aligned
wrap - constant specifying how the text needs to be aligned
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,
                      boolean wrap)
               throws IOException,
                      PdfException
Writes text str with specified wrap setting on this PdfPage.

Parameters:
str - text that 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,
                      int alignment)
               throws IOException,
                      PdfException
Writes str with specified alignment.

Parameters:
str - text that needs to be written
alignment - constant specifying how the text needs to be aligned
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)
               throws IOException,
                      PdfException
Writes specified text with specified font.

Parameters:
str - text that needs to be written
f - font with which 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,
                      int alignment,
                      boolean wrap)
               throws IOException,
                      PdfException
Writes text str with specified font, alignment, and wrap setting.

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:
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,
                      boolean wrap)
               throws IOException,
                      PdfException
Writes text str with specified font and wrap setting.

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:
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)
               throws IOException,
                      PdfException
Writes text str with specified font and alignment.

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:
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)
               throws IOException,
                      PdfException
Writes text str at position (x, y).

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:
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 p)
               throws IOException,
                      PdfException
Writes specified text at specified point.

Parameters:
str - text that needs to be written
p - 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
Sample Code
See example.

writeText

public void writeText(String str,
                      double x,
                      double y,
                      int alignment)
               throws IOException,
                      PdfException
Writes text str at position (x, y) with specified alignment.

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:
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 p,
                      int alignment)
               throws IOException,
                      PdfException
Writes text str with specified alignment at specified point.

Parameters:
str - text that needs to be written
p - PdfPoint where the text needs to be written
alignment - constant specifying how the text needs to be aligned
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)
               throws IOException,
                      PdfException
Writes text str at position (x, y) with specified font.

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:
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 p)
               throws IOException,
                      PdfException
Writes text str with specified font at specified point.

Parameters:
str - text that needs to be written
f - font with which the text needs to be written
p - 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
Sample Code
See example.

writeText

public void writeText(String str,
                      PdfFont f,
                      int alignment,
                      double x,
                      double y)
               throws IOException,
                      PdfException
Writes text str at position (x, y) with specified font and alignement

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,
                      PdfPoint p)
               throws IOException,
                      PdfException
Writes text str with specified font and alignment at specified point.

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
p - 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
Sample Code
See example.

writeText

public void writeText(String str,
                      PdfFont f,
                      double x,
                      double y,
                      boolean wrap)
               throws IOException,
                      PdfException
Writes text str at position (x, y) with specified font and wrap setting.

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,
                      PdfPoint p,
                      boolean wrap)
               throws IOException,
                      PdfException
Writes text str with specified font and wrap setting at specified point.

Parameters:
str - text that needs to be written
f - font with which the text needs to be written
p - 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,
                      double x,
                      double y,
                      boolean wrap)
               throws IOException,
                      PdfException
Writes text str at position (x, y) with specified font, alignment, and wrap setting.

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,
                      PdfPoint p,
                      boolean wrap)
               throws IOException,
                      PdfException
Writes text str with specified font, alignment, and wrap setting at specified point.

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
p - 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,
                      double x,
                      double y,
                      boolean wrap)
               throws IOException,
                      PdfException
Writes text str at position (x, y) with specified wrap setting.

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 how the text needs to be aligned
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 p,
                      boolean wrap)
               throws IOException,
                      PdfException
Writes text str with specified wrap setting at specified point.

Parameters:
str - text that needs to be written
p - 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,
                      double x,
                      double y,
                      int alignment,
                      boolean wrap)
               throws IOException,
                      PdfException
Writes str at position (x, y) with specified alignment and wrap setting.

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
Sample Code
See example.

writeText

public void writeText(String str,
                      PdfPoint p,
                      int alignment,
                      boolean wrap)
               throws IOException,
                      PdfException
Writes text str with specified alignment and wrap setting at specified point.

Parameters:
str - text that needs to be written
p - 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
Sample Code
See example.

writeText

public void writeText(String str,
                      PdfPoint p,
                      double rotation)
               throws IOException,
                      PdfException
Writes text str, rotated by rotation degrees, at specified point.

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

This method is recommended only for writing rotated single-line text. For writing rotated multi-line text, the PdfStdPage.writeText(String, PdfRect, double, double) method is preferred.

Parameters:
str - text that needs to be written
p - 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,
                      double x,
                      double y,
                      double rotation)
               throws IOException,
                      PdfException
Writes text str, rotated by rotation degrees, at position (x, y).

The text is rotated on center of its bounding box by rotation 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,
                      PdfFont f,
                      PdfPoint p,
                      double rotation)
               throws IOException,
                      PdfException
Writes text str, rotated by rotation degrees, at specified point with specified font.

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

This method is recommended only for writing rotated single-line text. For writing rotated multi-line text, the PdfStdPage.writeText(String, PdfFont, PdfRect, double, double) method is preferred over this.

Parameters:
str - text that needs to be written
f - font with which the text needs to be written
p - 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,
                      double x,
                      double y,
                      double rotation)
               throws IOException,
                      PdfException
Writes text str, rotated by rotation degrees, at specified position with specified font.

The text is rotated on center of its bounding box by rotation 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,
                      PdfRect rect)
               throws IOException,
                      PdfException
Writes specified text inside specified rectanlge.

Parameters:
str - text that needs to be written
rect - rectangle inside which 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 rect,
                      double rotation,
                      double firstLinePosition)
               throws IOException,
                      PdfException
Writes text str, rotated by rotation degrees, with specified first-line position inside specified rectangle.

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

Parameters:
str - text that needs to be written
rect - 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
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 rect,
                      int alignment)
               throws IOException,
                      PdfException
Writes text str with specified alignment inside specified rectangle.

Parameters:
str - text that needs to be written
rect - 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,
                      PdfRect rect,
                      int alignment,
                      double rotation,
                      double firstLinePosition)
               throws IOException,
                      PdfException
Writes text str, rotated by rotation degrees, with specified alignment and first-line position inside specified rectangle.

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

Parameters:
str - text that needs to be written
rect - 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
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 rect)
               throws IOException,
                      PdfException
Writes text str with specified font inside specified rectangle.

Parameters:
str - text that needs to be written
f - font with which the text needs to be written
rect - rectangle inside which 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 rect,
                      double rotation,
                      double firstLinePosition)
               throws IOException,
                      PdfException
Writes text str, rotated by rotation degrees, with specified font and first-line position inside specified rectangle.

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

Parameters:
str - text that needs to be written
f - font with which the text needs to be written
rect - 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
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 rect,
                      int alignment)
               throws IOException,
                      PdfException
Writes text str with specified font and alignment inside specified rectangle.

Parameters:
str - text that needs to be written
f - font with which the text needs to be written
rect - 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 rect,
                      int alignment,
                      double rotation,
                      double firstLinePosition)
               throws IOException,
                      PdfException
Writes text str, rotated by rotation degrees, with specified font, alignment, and first-line position inside specified rectangle.

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

Parameters:
str - text that needs to be written
f - font with which the text needs to be written
rect - 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
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).

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 width,
                      double height)
               throws IOException,
                      PdfException
Draws image, specified by its pathname, at position (x, y) with specified width and height.

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,
                      PdfPoint p)
               throws IOException,
                      PdfException
Draws image, specified by its pathname, at point p.

Parameters:
path - pathname of the image file
p - 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 p,
                      double width,
                      double height)
               throws IOException,
                      PdfException
Draws image, specified by its pathname, at point p with specified width and height.

Parameters:
path - pathname of the image file
p - 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,
                      PdfRect rect)
               throws IOException,
                      PdfException
Draws image, specified by its pathname, on rectangle rect.

Parameters:
path - pathname of the image file
rect - rectangle on 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,
                      double x,
                      double y)
               throws IOException,
                      PdfException
Draws specified image at position (x, y).

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
Draws an image at specified location with specified stretching and aspect ratio settings. 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,
                      double width,
                      double height)
               throws IOException,
                      PdfException
Draws specified image at position (x, y) with specified width and height.

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,
                      PdfPoint p)
               throws IOException,
                      PdfException
Draws specified image at specified point.

Parameters:
img - image that needs to be drawn
p - 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 p,
                      double width,
                      double height)
               throws IOException,
                      PdfException
Draws specified image at point p with specified width and height.

Parameters:
img - image that needs to be drawn
p - 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,
                      PdfRect rect)
               throws IOException,
                      PdfException
Draws specified image on specified rectangle.

Parameters:
img - image that needs to be drawn
rect - rectangle on 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,
                      double x,
                      double y,
                      double rotation)
               throws IOException,
                      PdfException
Draw image, specified by its pathname and rotated by rotation degrees, at position (x, y).

The image is rotated on center of its bounding box by rotation 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,
                      double rotation)
               throws IOException,
                      PdfException
Draws image, specified by its pathname and rotated by rotation degrees, at position (x, y) with specified width and height.

The image is rotated on center of its bounding box by rotation 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,
                      PdfPoint p,
                      double rotation)
               throws IOException,
                      PdfException
Draws image, specified by its pathname and rotated by rotation degrees, at point p.

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

Parameters:
path - pathname of the image file
p - 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 p,
                      double width,
                      double height,
                      double rotation)
               throws IOException,
                      PdfException
Draws image, specified by its pathname and rotated by rotation degrees, at point p with specified width and height.

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

Parameters:
path - pathname of the image file
p - 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,
                      PdfRect rect,
                      double rotation)
               throws IOException,
                      PdfException
Draws image, specified by its pathname and rotated by rotation degrees, on rectangle rect.

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

Parameters:
path - pathname of the image file
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,
                      double x,
                      double y,
                      double rotation)
               throws IOException,
                      PdfException
Draws specified image, rotated by rotation degrees, at position (x, y).

The image is rotated on center of its bounding box by rotation 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 rotation,
                      boolean scaleToFit,
                      boolean stretch)
               throws IOException,
                      PdfException
Draws an image at specified location with specified rotation, stretching and aspect ratio settings. 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 right or bottom edge 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
rotation - (measured in anti-clockwise direction and expressed in degrees) tilt of the image with reference to center of its bounding box
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,
                      double width,
                      double height,
                      double rotation)
               throws IOException,
                      PdfException
Draw specified image, rotated by rotation degrees, at position (x, y) with specified height and width.

The image is rotated on center of its bounding box by rotation 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,
                      PdfPoint p,
                      double rotation)
               throws IOException,
                      PdfException
Draws specified image, rotated by rotation degrees, at point p.

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

Parameters:
img - image that needs to be drawn
p - 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 p,
                      double width,
                      double height,
                      double rotation)
               throws IOException,
                      PdfException
Draws specified image, rotated by rotation degrees, at point p with specified width and height.

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

Parameters:
img - image that needs to be drawn
p - 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,
                      PdfRect rect,
                      double rotation)
               throws IOException,
                      PdfException
Draws specified image, rotated by rotation degrees, on specified rectangle.

The image is rotated on center of its bounding box by rotation 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.

drawLine

public void drawLine(double startx,
                     double starty,
                     double endx,
                     double endy)
              throws IOException
Draws a line between positions (startx, starty) and (endx, endy).

Parameters:
startx - x-coordinate of the starting position of the line
starty - y-coordinate of the starting position of the line
endx - x-coordinate of the ending position of the line
endy - y-coordinate of the ending position of the line
Throws:
IOException - if an I/O error occurs.
Since:
1.0
Sample Code
See example.

drawLine

public void drawLine(PdfPoint start,
                     PdfPoint end)
              throws IOException
Draws a line between points start and end.

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

drawRect

public void drawRect(PdfPoint p,
                     double width,
                     double height,
                     boolean isFill,
                     boolean isStroke)
              throws IOException
Draws a rectangle at specified point with specified width, height, brush, and pen settings.

Parameters:
p - position of the 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.
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
Draws a rectangle 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
Throws:
IOException - if an I/O error occurs.
Since:
1.0
Sample Code
See example.

drawRect

public void drawRect(Rectangle r)
              throws IOException
Draws a rectangle with specified Rectangle object.

Parameters:
r - rectangle that needs to be drawn
Throws:
IOException - if an I/O error occurs.

drawRect

public void drawRect(PdfRect r)
              throws IOException
Draws a rectangle.

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

drawRect

public void drawRect(double x,
                     double y,
                     double width,
                     double height)
              throws IOException
Draws a rectangle at position (x, y) with specified 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
Throws:
IOException - if an I/O error occurs.
Since:
1.0
Sample Code
See example.

drawRect

public void drawRect(PdfPoint p,
                     double width,
                     double height)
              throws IOException
Draws a rectangle at specified point with specified width and height.

Parameters:
p - position of the top-left corner of the rectangle
width - width of the rectangle
height - height of the rectangle
Throws:
IOException - if an I/O error occurs.
Since:
1.0
Sample Code
See example.

drawSquare

public void drawSquare(double x,
                       double y,
                       double length,
                       boolean isFill,
                       boolean isStroke)
                throws IOException
Draws a square at position (x, y) with specified fill and stroke settings.

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.
Since:
1.0
Sample Code
See example.

drawSquare

public void drawSquare(double x,
                       double y,
                       double length)
                throws IOException
Draws a square at position (x, y).

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.
Since:
1.0
Sample Code
See example.

drawSquare

public void drawSquare(PdfPoint p,
                       double length,
                       boolean isFill,
                       boolean isStroke)
                throws IOException
Draws a square at point p with specified fill and stroke settings.

Parameters:
p - position of top-left corner of the rectangle
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.
Since:
1.0
Sample Code
See example.

drawSquare

public void drawSquare(PdfPoint p,
                       double length)
                throws IOException
Draws a square at point p.

Parameters:
p - position of top-left corner of the rectangle
length - length of a side of the square
Throws:
IOException - if an I/O error occurs.
Since:
1.0
Sample Code
See example.

drawBezierCurve

public void drawBezierCurve(PdfPoint start,
                            PdfPoint controlPoint1,
                            PdfPoint controlPoint2,
                            PdfPoint end,
                            boolean isFill,
                            boolean isStroke)
                     throws IOException
Draws a Bézier curve with two control points.

Parameters:
start - starting point of the curve
controlPoint1 - first control point of the curve
controlPoint2 - second control point of the curve
end - 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.
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
Draws a Bézier curve with control points at (ctrlX1, ctrlY1) and (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.
Since:
1.0
Sample Code
See example.

drawBezierCurve

public void drawBezierCurve(PdfPoint start,
                            PdfPoint control,
                            PdfPoint end,
                            boolean isFill,
                            boolean isStroke)
                     throws IOException
Draws a Bézier curve with a single control point.

Parameters:
start - starting point of the curve
control - control point of the curve
end - 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.
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
Draws a Bézier curve with a control point specified by (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.
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
Draws an ellipse whose bounding box has its top-left corner at (x1, y1) and its bottom-right corner at (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.
Since:
1.0
Sample Code
See example.

drawEllipse

public void drawEllipse(PdfPoint p1,
                        PdfPoint p2,
                        boolean isFill,
                        boolean isStroke)
                 throws IOException
Draws an ellipse whose bounding box has its top-left corner at point1 and its bottom-right corner at point2.

Parameters:
p1 - top-left corner of the ellipse's bounding box
p2 - 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.
Since:
1.0
Sample Code
See example.

drawCircle

public void drawCircle(double x,
                       double y,
                       double radius,
                       boolean isFill,
                       boolean isStroke)
                throws IOException
Draws a circle with its center at position (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.
Since:
1.0
Sample Code
See example.

drawCircle

public void drawCircle(PdfPoint center,
                       double radius,
                       boolean isFill,
                       boolean isStroke)
                throws IOException
Draws a circle with its center at the specified point.

Parameters:
center - position 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.
Since:
1.0
Sample Code
See example.

drawPolyline

public void drawPolyline(double[] xPoints,
                         double[] yPoints,
                         int nPoints)
                  throws IOException,
                         PdfException
Draws a polyline.

Parameters:
xPoints - array containing x-coordinates of the kinks in the polyline
yPoints - array containing y-coordinates of the kinks in the polyline
nPoints - number of kinks in the polyline
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.

Parameters:
xPoints - array containing x-coordinates of the corners of the polygon
yPoints - array containing y-coordinates of the corners of the polygon
nPoints - number of sides of 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.

drawArc

public void drawArc(PdfRect rect,
                    double startAngle,
                    double sweepAngle)
             throws IOException
Draws an arc. Rectangle rect specifies bounding box of an imaginary circle, which completes the arc. The arc begins at startAngle degrees and spans for sweepAngle 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
sweepAngle - (expressed in degrees) angle for which the arc needs to span
Throws:
IOException - if an I/O error occurs.
Since:
1.0
Sample Code
See example.

drawPie

public void drawPie(double x,
                    double y,
                    double width,
                    double height,
                    double startAngle,
                    double sweepAngle,
                    boolean isFill,
                    boolean isStroke)
             throws IOException
Draws a pie segment. 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 - x-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
sweepAngle - (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.
Since:
1.0
Sample Code
See example.

drawRoundRect

public void drawRoundRect(PdfRect rect,
                          double arcWidth,
                          double arcHeight,
                          boolean isFill,
                          boolean isStroke)
                   throws IOException
Draws rectangle rect with specified rounded corners.

Parameters:
rect - rectangle that needs to be drawn
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.
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
Draws a rectangle with rounded corners. 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
Since:
1.0
Sample Code
See example.

getFont

public PdfFont getFont()
Returns default font used to render text elements on this page.

If no default font was specified, this methods returns PdfFont object for Helvetica 10 pt.

Returns:
default font used by this API on this page
See Also:
PdfStdPage.setFont(PdfFont)

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