Gnostice PDFOne
Pro. Ed. v1.41


com.gnostice.pdfone
Class PdfAnnot

java.lang.Object
  extended bycom.gnostice.pdfone.PdfAnnot
All Implemented Interfaces:
Cloneable, Usable
Direct Known Subclasses:
PdfLinkAnnot, com.gnostice.pdfone.PdfProAnnot

public abstract class PdfAnnot
extends Object
implements Cloneable, Usable

This is an abstract class representing annotations.

An "annotation rectangle" defines the position and size of an annotation on a page. This rectangle may be specified by coordinates of its top-left corner, width, and height. An annotation rectangle has to be compulsorily specified for an annotation. Even when a default constructor is used to create an annotation, an annotation rectangle should be specified subsequently. These specifications are applied in a literal sense. As a result, the actual position and size of an annotation on a page is wholly dependent on whatever measurement unit that is currently applicable.

Adding the same annotation to pages with different default measurement units, for example, will cause a shift in their relative positions.

        PdfWriter writer = PdfWriter.fileWriter(
            "PdfAnnot_INTRO_Example.pdf");
        PdfDocument document = new PdfDocument(writer);

        PdfPage page_point = new PdfPage();
        PdfPage page_pixel = new PdfPage();

        page_pixel.setMeasurementUnit(PdfMeasurement.MU_PIXELS); 
        page_point.setMeasurementUnit(PdfMeasurement.MU_POINTS); 

        // Creates a text annotation object 
        PdfTextAnnot tAnnot = new PdfTextAnnot();

        // Specifies properties of the annotation 
        tAnnot.setColor(Color.PINK);
        tAnnot.setIconName(PdfTextAnnot.ICON_KEY);        
        tAnnot.setTitle("Attn: All");
        tAnnot.setSubject("EOD Deliverables");
        tAnnot.setContents(
            "Please check this document. It has some errors.");
        tAnnot.setFlags(PdfAnnot.FLAG_PRINT);        
        tAnnot.setOpen(true);

        // Specifies the annotation rectangle of the annotation   
        tAnnot.setRect(300, 200, 100, 100); 

        // Adds clones of the same annotation to pages with 
        // different measurement units 
        // Makes them appear in different positions, relative to each other
        page_pixel.addAnnotation(tAnnot); 
        page_point.addAnnotation((PdfAnnot) tAnnot.clone()); 

        document.add(page_pixel);
        document.add(page_point);

        document.setOpenAfterSave(true);
        document.write();
        writer.dispose();
 

Since:
1.0
Version:
1.0

Field Summary
static int ANNOT_TYPE_CARET
          Caret annotation type.
static int ANNOT_TYPE_CIRCLE
          Circle annotation type.
static int ANNOT_TYPE_FILE_ATTACHMENT
          File attachment annotation type.
static int ANNOT_TYPE_FREE_TEXT
          Free text annotation type.
static int ANNOT_TYPE_INK
          Ink annotation type.
static int ANNOT_TYPE_LINE
          Line annotation type.
static int ANNOT_TYPE_LINK
          Link annotation type.
static int ANNOT_TYPE_MARKUP
          Markup annotation type.
static int ANNOT_TYPE_POLYGON
          Polygon annotation type.
static int ANNOT_TYPE_POLYLINE
          Polyline annotation type.
static int ANNOT_TYPE_POPUP
          Pop-up annotation type.
static int ANNOT_TYPE_SQUARE
          Square annotation type.
static int ANNOT_TYPE_STAMP
          Rubber stamp annotation type.
static int ANNOT_TYPE_TEXT
          Text annotation type.
static int ANNOT_TYPE_WATERMARK
           
static int BORDERSTYLE_BEVELED
          Annotation border style with which the border is drawn as an embossed rectangle that appears to have risen above the surface of the page.
static int BORDERSTYLE_DASHED
          Annotation border style with which the border is drawn as a dashed rectangle.
static int BORDERSTYLE_INSET
          Annotation border style with which the border is drawn as an engraved rectangle that appears to have sunken below the surface of the page.
static int BORDERSTYLE_SOLID
          Annotation border style with which the border is drawn as a solid rectangle.
static int BORDERSTYLE_UNDERLINE
          Annotation border style with which the annotation rectangle's bottom line is drawn as the border.
static int FLAG_HIDDEN
          Flag to indicate whether an annotation is displayed, printed, or allowed to interact with the user, irrespective of the annotation's type or the existence of an annotation handler.
static int FLAG_INVISIBLE
          Flag to indicate whether an annotation is displayed using its appearance stream if it does not belong to one of the standard annotation types and if no annotation handler is specified.
static int FLAG_LOCKED
          Flag to indicate whether an annotation is not allowed to be deleted or have its properties modified by the user.
static int FLAG_NO_ROTATE
          Flag to indicate whether an annotation is rotated in sync with rotation of its page.
static int FLAG_NO_VIEW
          Flag to indicate whether an annotation is displayed or allowed to interact with the user.
static int FLAG_NO_ZOOM
          Flag to indicate whether an annotation is magnified in sync with zoom level of its page.
static int FLAG_PRINT
          Flag to indicate whether an annotation is printed when the page is printed.
static int FLAG_READONLY
          Flag to indicate whether an annotation is allowed to interact with the user.
static int FLAG_TOGGLE_NO_VIEW
          Flag to indicate whether the implementation of the FLAG_NO_VIEW of an annotation is to be inverted.
 
Fields inherited from interface com.gnostice.pdfone.Usable
INCHES_TO_POINTS, MM_TO_INCHES, MM_TO_POINTS, PDF_A, PDF_AA, PDF_AC, PDF_ACROFORM, PDF_ACTION, PDF_ALTERNATEPRESENTATIONS, PDF_ANNOT, PDF_ANNOT_DEFAULT_TITLE, PDF_ANNOT_NAME, PDF_ANNOT_SUBJECT, PDF_ANNOTS, PDF_AP, PDF_ARRAYEND, PDF_ARRAYSTART, PDF_ARTBOX, PDF_AS, PDF_ASCENT, PDF_ASCII85, PDF_ASCII85_NEW, PDF_ASCIIHEX, PDF_ASCIIHEX_NEW, PDF_AUTHOR, PDF_AVGWIDTH, PDF_B, PDF_BASEFONT, PDF_BBOX, PDF_BC, PDF_BE, PDF_BEFOREFORMAT, PDF_BEGINTEXT, PDF_BG, PDF_BINARYDATA, PDF_BITS_PER_COMPONENT, PDF_BL, PDF_BLEEDBOX, PDF_BLINDS, PDF_BMC, PDF_BORDER, PDF_BOX, PDF_BS, PDF_BTN, PDF_C, PDF_CA, PDF_CA_SMALL, PDF_CAPHEIGHT, PDF_CARETANNOT, PDF_CARRIAGE, PDF_CATALOG, PDF_CENTER_WINDOW, PDF_CH, PDF_CID_TO_GID_MAP, PDF_CIDFONT_TYPE1, PDF_CIDFONT_TYPE2, PDF_CIDSYSTEM_INFO, PDF_CIRCLEANNOT, PDF_CL, PDF_CM, PDF_COLOMNS, PDF_COLOR, PDF_COLORSPACE, PDF_CONTENTS, PDF_COUNT, PDF_COVER, PDF_CREATIONDATE, PDF_CREATOR, PDF_CROPBOX, PDF_CS, PDF_CSP, PDF_D, PDF_DA, PDF_DATE, PDF_DATE_FORMAT, PDF_DCTDECODE, PDF_DCTDECODE_NEW, PDF_DECODEPARMS, PDF_DESC, PDF_DESCENDANT, PDF_DESCENDANT_FONTS, PDF_DESCENT, PDF_DESTINATION, PDF_DESTS, PDF_DEVICE_CMYK, PDF_DEVICE_GRAY, PDF_DEVICE_RGB, PDF_DI, PDF_DICTEND, PDF_DICTSTART, PDF_DIRECTION, PDF_DISPLAY_DOCTITLE, PDF_DISPLAY_DURATION, PDF_DISSOLVE, PDF_DM, PDF_DOC_SUBJECT, PDF_DOS, PDF_DP, PDF_DR, PDF_DS, PDF_DV, PDF_DW, PDF_E, PDF_EF, PDF_EMBEDDEDFILE, PDF_EMBEDDEDFILES, PDF_EMC, PDF_ENCODING, PDF_ENCRYPT, PDF_ENDOBJ, PDF_ENDPATH, PDF_ENDSTREAM, PDF_ENDTEXT, PDF_EOCLIP, PDF_EOF, PDF_EXTGSTATE, PDF_F, PDF_FADE, PDF_FALSE, PDF_FDESCRIPTOR, PDF_FIELD_FLAG, PDF_FIELDS, PDF_FILEATTACHMENTANNOT, PDF_FILESPEC, PDF_FILTER, PDF_FIRST, PDF_FIRST_PAGE, PDF_FIRSTCHAR, PDF_FIT, PDF_FIT_WINDOW, PDF_FITB, PDF_FITBH, PDF_FITBV, PDF_FITH, PDF_FITR, PDF_FITV, PDF_FIXEDPRINT, PDF_FLAGS, PDF_FLATE, PDF_FLATE_NEW, PDF_FLY, PDF_FO, PDF_FONT, PDF_FONTBBOX, PDF_FONTFILE, PDF_FONTFILE_2, PDF_FontFile_3, PDF_FONTNAME, PDF_FONTNAMEPREFIX, PDF_FORM, PDF_FORMFEED, PDF_FORMFONTPREFIX, PDF_FREE_TEXT_TYPEWRITER, PDF_FREETEXTANNOT, PDF_FS, PDF_FT, PDF_FULLSCREEN, PDF_GLITTER, PDF_GOTO_ACTION, PDF_GROUP, PDF_GS, PDF_H, PDF_HEADER, PDF_HEIGHT, PDF_HEXSTRINGEND, PDF_HEXSTRINGSTART, PDF_HIDE_MENUBAR, PDF_HIDE_TOOLBAR, PDF_HIDE_WINDOWUI, PDF_HORIZ_STEM, PDF_HORIZONTAL, PDF_I, PDF_IC, PDF_ID, PDF_IDS, PDF_IF, PDF_IMAGE, PDF_IMAGEB, PDF_IMAGEC, PDF_IMAGEI, PDF_IMPORTDATA, PDF_INDEX, PDF_INDEXED, PDF_INFO, PDF_INK, PDF_INKLIST, PDF_INWARD, PDF_IT, PDF_ITALANGLE, PDF_IX, PDF_JAVASCRIPT, PDF_JAVASCRIPT_ACTION, PDF_JS, PDF_KEYSTROKE, PDF_KEYWORDS, PDF_KIDS, PDF_L, PDF_L2R, PDF_LANG, PDF_LAST, PDF_LAST_PAGE, PDF_LASTCHAR, PDF_LAUNCH_ACTION, PDF_LE, PDF_LEGAL, PDF_LENGTH, PDF_LENGTH_1, PDF_LENGTH_2, PDF_LENGTH_3, PDF_LF, PDF_LINEANNOT, PDF_LINKANNOT, PDF_LITERALSTRINGEND, PDF_LITERALSTRINGSTART, PDF_LZWDECODE, PDF_M, PDF_MAC, PDF_MARKINFO, PDF_MAXLEN, PDF_MAXWIDTH, PDF_MEDIABOX, PDF_METADATA, PDF_MISSINGWIDTH, PDF_MK, PDF_MODDATE, PDF_N, PDF_NAME, PDF_NAMED, PDF_NAMED_ACT_FIND, PDF_NAMED_ACT_OPEN, PDF_NAMED_ACT_PRINT, PDF_NAMED_ACT_SEARCH, PDF_NAMES, PDF_NAMESTART, PDF_NEEDAPPEARANCES, PDF_NEWLINE, PDF_NEWWINDOW, PDF_NEXT, PDF_NEXT_PAGE, PDF_NO_COMP_OBJ, PDF_NONFULLSCREEN_PAGEMODE, PDF_NULL, PDF_O, PDF_OBJ, PDF_OBJSTREAM, PDF_OCPROPERTIES, PDF_OFF, PDF_ONECOLUMN, PDF_OPEN, PDF_OPEN_ACTION, PDF_OPT, PDF_OUTLINES, PDF_OUTPUTINTENTS, PDF_OUTWARD, PDF_P, PDF_PAGE, PDF_PAGECLOSE, PDF_PAGEINVISIBLE, PDF_PAGELABELS, PDF_PAGELAYOUT, PDF_PAGEMODE, PDF_PAGEOPEN, PDF_PAGES, PDF_PAGEVISIBLE, PDF_PAINT_TYPE, PDF_PARAMS, PDF_PARENT, PDF_PATTERN, PDF_PATTERN_TYPE, PDF_PBD, PDF_PC, PDF_PDC, PDF_PDF, PDF_PERMS, PDF_PFD, PDF_PH, PDF_PIECEINFO, PDF_POLYGONANNOT, PDF_POLYLINEANNOT, PDF_POPUP, PDF_PREDICTOR, PDF_PREV, PDF_PREV_PAGE, PDF_PROCSET, PDF_PRODUCER, PDF_PROPERTIES, PDF_PUSH, PDF_PV, PDF_Q, PDF_QUADPOINTS, PDF_R, PDF_R2L, PDF_RC, PDF_RD, PDF_RE, PDF_RECALCULATE, PDF_RECT, PDF_REMOTEGOTO_ACTION, PDF_RENDITIONS, PDF_REPLACE, PDF_RESET_FORM, PDF_RESOURCES, PDF_RESTORE_GS, PDF_RI, PDF_ROOT, PDF_ROTATE, PDF_RUNLENGTH, PDF_RUNLENGTH_NEW, PDF_S, PDF_SCN, PDF_SHADING, PDF_SHOWIMG, PDF_SHOWTEXT, PDF_SINGLE_QUOTES, PDF_SINGLEPAGE, PDF_SIZE, PDF_SP, PDF_SPIDERINFO, PDF_SPLIT, PDF_SQUAREANNOT, PDF_SS, PDF_STAMPANNOT, PDF_STARTXREF, PDF_STORE_GS, PDF_STREAM, PDF_STRUCT_TREE, PDF_SUBMIT_FORM, PDF_SUBTYPE, PDF_T, PDF_TAB, PDF_TEMPLATES, PDF_TEXT, PDF_TEXTANNOT, PDF_TEXTDIMENSION, PDF_TEXTFONT, PDF_TEXTLEAD, PDF_TEXTMATRIX, PDF_TEXTNEWLINESTART, PDF_TEXTRENDER, PDF_TEXTWIDTH, PDF_THREADS, PDF_THUMB, PDF_TILING_TYPE, PDF_TITLE, PDF_TM, PDF_TOUNICODE, PDF_TP, PDF_TRAILER, PDF_TRANSITION, PDF_TRIMBOX, PDF_TRUE, PDF_TRUETYPE, PDF_TU, PDF_TWOCOLUMN_LEFT, PDF_TWOCOLUMN_RIGHT, PDF_TWOPAGE_LEFT, PDF_TWOPAGE_RIGHT, PDF_TX, PDF_TYPE, PDF_TYPE0, PDF_TYPE1, PDF_U, PDF_UNCOVER, PDF_UNIX, PDF_URI_ACTION, PDF_URL, PDF_URLS, PDF_USEATTACHMENTS, PDF_USENONE, PDF_USEOC, PDF_USEOUTLINES, PDF_USETHUMBS, PDF_V, PDF_VALUECHANGE, PDF_VERSION, PDF_VERT_STEM, PDF_VERTICAL, PDF_VERTICES, PDF_VIEWER_PREFERENCES, PDF_W, PDF_WATERMARKANNOT, PDF_WIDGET, PDF_WIDTH, PDF_WIDTHS, PDF_WINANSIENCODING, PDF_WIPE, PDF_X, PDF_XOBJECT, PDF_XREF, PDF_XREFSTMOFFSET, PDF_XREFSTREAM, PDF_XSTEP, PDF_XYZ, PDF_YES, PDF_YSTEP, PIXEL_PER_INCH, RUBICON_EMBEDDED, SITE, TEXT, TWIPS_TO_POINTS
 
Method Summary
 String getAnnotName()
          Returns annotation name.
 int getBorderStyle()
          Returns constant identifying annotation's border style.
 double getBorderWidth()
          Returns width of this annotation's border.
 double getBottom()
          Returns distance from top edge of page to bottom edge of this annotation's annotation rectangle.
 Color getColor()
          Returns color of this annotation's popup.
 String getContents()
          Returns text displayed by this annotation.
 int[] getDashPattern()
          Returns an array containing lengths of dashes and gaps in this annotation's dash pattern.
 int getFlags()
          Returns combined value of flags representing various characteristics of this annotation.
 double getLeft()
          Returns distance from left edge of page to left edge of this annotation's annotation rectangle.
 PdfRect getRect()
          Returns annotation rectangle of this annotation.
 double getRight()
          Returns distance from left edge of page and right edge of this annotation's annotation rectangle.
 String getSubject()
          Returns text used as subject of this annotation's contents.
 String getTitle()
          Returns text used in this annotation's title bar.
 double getTop()
          Returns distance from top edge of page to top edge of this annotation's rectangle.
 int getType()
           
 int hashCode()
           
 boolean isShowRect()
          Returns whether this annotation's border is displayed.
 void setAnnotName(String name)
          Specifies unique name for this annotation in its document.
 void setBorderStyle(int borderStyle)
          Specifies this annotation's border style.
 void setBorderWidth(double borderWidth)
          Specifies width of this annotation's border.
 void setColor(Color color)
          Specifies color of this annotation's popup.
 void setContents(String contents)
          Specifies contents for this annotation.
 void setDashPattern(int[] dashPattern)
          Specifies lengths of dashes and gaps for this annotation's dash pattern.
 void setFlags(int flags)
          Specifies flags representing various characteristics of this annotation.
 void setRect(double x, double y, double width, double height)
          Specifies annotation rectangle for this annotation at (x, y) with specified width and height.
 void setRect(double x, double y, double width, double height, int measurementUnit)
          Specifies annotation rectangle for this annotation in specified measurement unit.
 void setRect(PdfRect rect)
          Specifies PdfRect object as annotation rectangle for this annotation.
 void setRect(PdfRect rect, int measurementUnit)
          Specifies PdfRect object as annotation rectangle for this annotation in specified measurement unit.
 void setRect(Rectangle rect)
          Specifies Rectangle object as annotation rectangle for this annotation.
 void setShowRect(boolean showRect)
          Specifies whether this annotation's border needs to be displayed.
 void setSubject(String subject)
          Specifies text to be used as subject of this annotation.
 void setTitle(String title)
          Specifies text to be displayed in title bar of this annotation's popup window.
 
Methods inherited from class java.lang.Object
equals, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FLAG_INVISIBLE

public static final int FLAG_INVISIBLE
Flag to indicate whether an annotation is displayed using its appearance stream if it does not belong to one of the standard annotation types and if no annotation handler is specified.

See Also:
Constant Field Values

FLAG_HIDDEN

public static final int FLAG_HIDDEN
Flag to indicate whether an annotation is displayed, printed, or allowed to interact with the user, irrespective of the annotation's type or the existence of an annotation handler. Used where space is limited and annotations are alternatively hidden and displayed in combination with appearance streams.

See Also:
Constant Field Values

FLAG_PRINT

public static final int FLAG_PRINT
Flag to indicate whether an annotation is printed when the page is printed.

See Also:
Constant Field Values

FLAG_NO_ZOOM

public static final int FLAG_NO_ZOOM
Flag to indicate whether an annotation is magnified in sync with zoom level of its page.

See Also:
Constant Field Values

FLAG_NO_ROTATE

public static final int FLAG_NO_ROTATE
Flag to indicate whether an annotation is rotated in sync with rotation of its page.

See Also:
Constant Field Values

FLAG_NO_VIEW

public static final int FLAG_NO_VIEW
Flag to indicate whether an annotation is displayed or allowed to interact with the user. Has no effect on whether the annotation is printed, which is solely determined by the FLAG_PRINT flag.

See Also:
FLAG_TOGGLE_NO_VIEW, Constant Field Values

FLAG_READONLY

public static final int FLAG_READONLY
Flag to indicate whether an annotation is allowed to interact with the user.

See Also:
Constant Field Values

FLAG_LOCKED

public static final int FLAG_LOCKED
Flag to indicate whether an annotation is not allowed to be deleted or have its properties modified by the user.

See Also:
Constant Field Values

FLAG_TOGGLE_NO_VIEW

public static final int FLAG_TOGGLE_NO_VIEW
Flag to indicate whether the implementation of the FLAG_NO_VIEW of an annotation is to be inverted.

See Also:
Constant Field Values

BORDERSTYLE_SOLID

public static final int BORDERSTYLE_SOLID
Annotation border style with which the border is drawn as a solid rectangle.

See Also:
Constant Field Values

BORDERSTYLE_DASHED

public static final int BORDERSTYLE_DASHED
Annotation border style with which the border is drawn as a dashed rectangle.

See Also:
Constant Field Values

BORDERSTYLE_BEVELED

public static final int BORDERSTYLE_BEVELED
Annotation border style with which the border is drawn as an embossed rectangle that appears to have risen above the surface of the page.

See Also:
Constant Field Values

BORDERSTYLE_INSET

public static final int BORDERSTYLE_INSET
Annotation border style with which the border is drawn as an engraved rectangle that appears to have sunken below the surface of the page.

See Also:
Constant Field Values

BORDERSTYLE_UNDERLINE

public static final int BORDERSTYLE_UNDERLINE
Annotation border style with which the annotation rectangle's bottom line is drawn as the border.

See Also:
Constant Field Values

ANNOT_TYPE_FILE_ATTACHMENT

public static final int ANNOT_TYPE_FILE_ATTACHMENT
File attachment annotation type. This is a markup annotation.

See Also:
Constant Field Values

ANNOT_TYPE_FREE_TEXT

public static final int ANNOT_TYPE_FREE_TEXT
Free text annotation type. This is a markup annotation.

See Also:
Constant Field Values

ANNOT_TYPE_INK

public static final int ANNOT_TYPE_INK
Ink annotation type. This is a markup annotation.

See Also:
Constant Field Values

ANNOT_TYPE_LINE

public static final int ANNOT_TYPE_LINE
Line annotation type. This is a markup annotation.

See Also:
Constant Field Values

ANNOT_TYPE_MARKUP

public static final int ANNOT_TYPE_MARKUP
Markup annotation type.

See Also:
Constant Field Values

ANNOT_TYPE_POLYLINE

public static final int ANNOT_TYPE_POLYLINE
Polyline annotation type. This is a markup annotation.

See Also:
Constant Field Values

ANNOT_TYPE_POLYGON

public static final int ANNOT_TYPE_POLYGON
Polygon annotation type. This is a markup annotation.

See Also:
Constant Field Values

ANNOT_TYPE_POPUP

public static final int ANNOT_TYPE_POPUP
Pop-up annotation type. This is NOT a markup annotation.

See Also:
Constant Field Values

ANNOT_TYPE_STAMP

public static final int ANNOT_TYPE_STAMP
Rubber stamp annotation type. This is a markup annotation.

See Also:
Constant Field Values

ANNOT_TYPE_TEXT

public static final int ANNOT_TYPE_TEXT
Text annotation type. This is a markup annotation.

See Also:
Constant Field Values

ANNOT_TYPE_LINK

public static final int ANNOT_TYPE_LINK
Link annotation type. This is NOT a markup annotation.

See Also:
Constant Field Values

ANNOT_TYPE_CARET

public static final int ANNOT_TYPE_CARET
Caret annotation type. This is a markup annotation.

See Also:
Constant Field Values

ANNOT_TYPE_SQUARE

public static final int ANNOT_TYPE_SQUARE
Square annotation type. This is a markup annotation.

See Also:
Constant Field Values

ANNOT_TYPE_CIRCLE

public static final int ANNOT_TYPE_CIRCLE
Circle annotation type. This is a markup annotation.

See Also:
Constant Field Values

ANNOT_TYPE_WATERMARK

public static final int ANNOT_TYPE_WATERMARK
See Also:
Constant Field Values
Method Detail

hashCode

public int hashCode()

getType

public int getType()

getSubject

public String getSubject()
Returns text used as subject of this annotation's contents.

Returns:
text used as subject of the annotation's contents
Since:
1.0

setSubject

public void setSubject(String subject)
Specifies text to be used as subject of this annotation.

Parameters:
subject - text to be used as subject of the annotation
Since:
1.0
See Also:
getSubject()
Sample Code
See example.

getTitle

public String getTitle()
Returns text used in this annotation's title bar.

Returns:
text used in the annotation's title bar
Since:
1.0
See Also:
setTitle(String)

setTitle

public void setTitle(String title)
Specifies text to be displayed in title bar of this annotation's popup window.

Parameters:
title - text to be displayed in title bar of the annotation's popup window
Since:
1.0
See Also:
getTitle()
Sample Code
See example.

getColor

public Color getColor()
Returns color of this annotation's popup.

Returns:
color of the annotation's popup
Since:
1.0
See Also:
setColor(Color)

setColor

public void setColor(Color color)
Specifies color of this annotation's popup.

Parameters:
color - color of the annotation's popup
Since:
1.0
See Also:
getColor()
Sample Code
See example.

getContents

public String getContents()
Returns text displayed by this annotation. If annotation does not display text, returns alternate description (typically used to ensure accessibility for people with disabilities).

Returns:
text displayed by this annotation
Since:
1.0
See Also:
setContents(String)

setContents

public void setContents(String contents)
Specifies contents for this annotation. If the annotation does not display text, specifies alternate description for it.

Parameters:
contents - contents of the annotation
Since:
1.0
See Also:
getContents()
Sample Code
See example.

getFlags

public final int getFlags()
Returns combined value of flags representing various characteristics of this annotation.

Returns:
combined value of flags representing various characteristics of the annotation
Since:
1.0
See Also:
setFlags(int)

setFlags

public final void setFlags(int flags)
Specifies flags representing various characteristics of this annotation.

Parameters:
flags - combined value of flags representing various characteristics of this annotation
Since:
1.0
See Also:
getFlags()
Sample Code
See example.

getAnnotName

public String getAnnotName()
Returns annotation name.

Returns:
name of the annotation
Since:
1.0
See Also:
getAnnotName()

setAnnotName

public void setAnnotName(String name)
Specifies unique name for this annotation in its document.

Parameters:
name - unique name for the annotation
Since:
1.0
See Also:
getAnnotName()
Sample Code
See example.

getBottom

public double getBottom()
Returns distance from top edge of page to bottom edge of this annotation's annotation rectangle.

Returns:
distance from top of page to bottom of the annotation rectangle
Since:
1.0

getLeft

public double getLeft()
Returns distance from left edge of page to left edge of this annotation's annotation rectangle.

Returns:
distance from left edge of page to left edge of the annotation rectangle
Since:
1.0

getRight

public double getRight()
Returns distance from left edge of page and right edge of this annotation's annotation rectangle.

Returns:
distance from left edge of page and right edge of the annotation rectangle.
Since:
1.0

getTop

public double getTop()
Returns distance from top edge of page to top edge of this annotation's rectangle.

Returns:
distance from top edge of page to top edge of the annotation's rectangle
Since:
1.0

getBorderStyle

public int getBorderStyle()
Returns constant identifying annotation's border style. Works with circle, ink, link, and square annotation types if border has been set to be displayed.

Returns:
constant identifying annotation's border style
Since:
1.0
See Also:
setBorderStyle(int)

setBorderStyle

public void setBorderStyle(int borderStyle)
Specifies this annotation's border style. Applicable to circle, ink, link, and square annotation types. Works if border has been set to be displayed.

Parameters:
borderStyle - constant specifying annotation's border style
Since:
1.0
See Also:
getBorderStyle()
Sample Code
See example.

getDashPattern

public int[] getDashPattern()
Returns an array containing lengths of dashes and gaps in this annotation's dash pattern.

Returns:
an array containing lengths of dashes and gaps in the annotation's dash pattern
Since:
1.0
See Also:
setDashPattern(int[])

setDashPattern

public void setDashPattern(int[] dashPattern)
Specifies lengths of dashes and gaps for this annotation's dash pattern. For this method to be effective, the border style needs to be set to BORDERSTYLE_DASHED using the setBorderStyle(int) method and the border must be set to be displayed using the setShowRect(boolean) method.

Parameters:
dashPattern - array containing lengths of dashes and gaps for this annotation's dash pattern
Since:
1.0
See Also:
getDashPattern()
Sample Code
See example.

getBorderWidth

public double getBorderWidth()
Returns width of this annotation's border.

Returns:
width of the annotation's border
Since:
1.0
See Also:
setBorderWidth(double)

setBorderWidth

public void setBorderWidth(double borderWidth)
Specifies width of this annotation's border.

Parameters:
borderWidth - width of the annotation's border
Since:
1.0
See Also:
getBorderWidth()

isShowRect

public boolean isShowRect()
Returns whether this annotation's border is displayed.

Returns:
whether the annotation's border is displayed
Since:
1.0
See Also:
setShowRect(boolean)

setShowRect

public void setShowRect(boolean showRect)
Specifies whether this annotation's border needs to be displayed.

Parameters:
showRect - whether the annotation's border needs to be displayed
Since:
1.0
See Also:
isShowRect()
Sample Code
See example.

getRect

public PdfRect getRect()
Returns annotation rectangle of this annotation.

Returns:
annotation rectangle of the annotation
Since:
1.0
See Also:
setRect(double, double, double, double), setRect(double, double, double, double, int), setRect(PdfRect), setRect(PdfRect, int), setRect(Rectangle)

setRect

public void setRect(PdfRect rect)
Specifies PdfRect object as annotation rectangle for this annotation.

The position and size of the rectangle are applied in the default measurement unit of the page to which the annotation is added.

Parameters:
rect - annotation rectangle for this annotation
Since:
1.0
See Also:
getRect()
Sample Code
See example.

setRect

public void setRect(PdfRect rect,
                    int measurementUnit)
Specifies PdfRect object as annotation rectangle for this annotation in specified measurement unit.

Parameters:
rect - annotation rectangle for this annotation
measurementUnit - measurement unit with which the annotation rectangle is specified
Since:
1.0
See Also:
getRect()
Sample Code
See example.

setRect

public void setRect(double x,
                    double y,
                    double width,
                    double height)
Specifies annotation rectangle for this annotation at (x, y) with specified width and height.

The position (x, y), and dimensions width and height are applied in the default measurement unit of the page to which the annotation is added.

Parameters:
x - x-coordinate of the annotation rectangle
y - y-coordinate of the annotation rectangle
width - width of the annotation rectangle
height - height of the annotation rectangle
Since:
1.0
See Also:
getRect()
Sample Code
See example.

setRect

public void setRect(double x,
                    double y,
                    double width,
                    double height,
                    int measurementUnit)
Specifies annotation rectangle for this annotation in specified measurement unit.

Parameters:
x - x-coordinate of the annotation rectangle
y - y-coordinate of the annotation rectangle
width - width of the annotation rectangle
height - height of the annotation rectangle
measurementUnit - measurement unit with which the annotation rectangle is specified
Since:
1.0
See Also:
getRect()
Sample Code
See example.

setRect

public void setRect(Rectangle rect)
Specifies Rectangle object as annotation rectangle for this annotation.

Parameters:
rect - annotation rectangle for this annotation
Since:
1.0
See Also:
getRect()
Sample Code
See example.

Gnostice PDFOne
Pro. Ed. v1.41

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