org.icepdf.core.pobjects.annotations
Class TextAnnotation

java.lang.Object
  extended by org.icepdf.core.pobjects.Dictionary
      extended by org.icepdf.core.pobjects.annotations.Annotation
          extended by org.icepdf.core.pobjects.annotations.MarkupAnnotation
              extended by org.icepdf.core.pobjects.annotations.TextAnnotation

public class TextAnnotation
extends MarkupAnnotation

A text annotation represents a “sticky note� attached to a point in the PDF document. When closed, the annotation shall appear as an icon; when open, it shall display a pop-up window containing the text of the note in a font and size chosen by the conforming reader. Text annotations shall not scale and rotate with the page; they shall behave as if the NoZoom and NoRotate annotation flags (see Table 165) were always set. Table 172shows the annotation dictionary entries specific to this type of annotation.

Since:
5.0

Field Summary
static java.lang.String CHECK_CONTENT_STREAM
           
static Name CHECK_ICON
           
static java.lang.String CHECK_MARK_CONTENT_STREAM
           
static Name CHECK_MARK_ICON
           
static java.lang.String CIRCLE_CONTENT_STREAM
           
static Name CIRCLE_ICON
           
static java.lang.String COMMENT_CONTENT_STREAM
           
static Name COMMENT_ICON
          Named text icon times.
static java.lang.String CROSS_CONTENT_STREAM
           
static java.lang.String CROSS_HAIRS_CONTENT_STREAM
           
static Name CROSS_HAIRS_ICON
           
static Name CROSS_ICON
           
static java.lang.String HELP_CONTENT_STREAM
           
static Name HELP_ICON
           
protected  Name iconName
           
static java.lang.String INSERT_CONTENT_STREAM
           
static Name INSERT_ICON
           
static java.lang.String KEY_CONTENT_STREAM
           
static Name KEY_ICON
           
static Name NAME_KEY
          Optional) The name of an icon that shall be used in displaying the annotation.
static java.lang.String NEW_PARAGRAPH_CONTENT_STREAM
           
static Name NEW_PARAGRAPH_ICON
           
protected  boolean open
           
static Name OPEN_KEY
          (Optional) A flag specifying whether the annotation shall initially be displayed open.
static java.lang.String PARAGRAPH_CONTENT_STREAM
           
static Name PARAGRAPH_ICON
           
static java.lang.String RIGHT_ARROW_CONTENT_STREAM
           
static Name RIGHT_ARROW_ICON
           
static java.lang.String RIGHT_POINTER_CONTENT_STREAM
           
static Name RIGHT_POINTER_ICON
           
static java.lang.String STAR_CONTENT_STREAM
           
static Name STAR_ICON
           
protected  java.lang.String state
           
static java.lang.String STATE_ACCEPTED
           
static java.lang.String STATE_CANCELLED
           
static java.lang.String STATE_COMPLETED
           
static Name STATE_KEY
          (Optional; PDF 1.5) The state to which the original annotation shall be set; see 12.5.6.3, “Annotation States.â€?

Default: “Unmarked� if StateModel is “Marked�; “None� if StateModel is “Review�.

static java.lang.String STATE_MARKED
          State names.
static Name STATE_MODEL_KEY
          (Required if State is present, otherwise optional; PDF 1.5) The state model corresponding to State; see 12.5.6.3, “Annotation States.â€?
static java.lang.String STATE_MODEL_MARKED
          State Models
static java.lang.String STATE_MODEL_REVIEW
           
static java.lang.String STATE_REJECTED
           
static java.lang.String STATE_REVIEW_NONE
           
static java.lang.String STATE_UNMARKED
           
protected  java.lang.String stateModel
           
static java.lang.String UP_ARROW_CONTENT_STREAM
           
static Name UP_ARROW_ICON
           
static java.lang.String UP_LEFT_ARROW_CONTENT_STREAM
           
static Name UP_LEFT_ARROW_ICON
           
 
Fields inherited from class org.icepdf.core.pobjects.annotations.MarkupAnnotation
CA_KEY, CREATION_DATE_KEY, creationDate, EX_DATA_KEY, inReplyToAnnotation, intent, IRT_KEY, IT_KEY, opacity, POPUP_KEY, popupAnnotation, RC_KEY, replyToRelation, richText, RT_KEY, SUBJ_KEY, subject, T_KEY, titleText
 
Fields inherited from class org.icepdf.core.pobjects.annotations.Annotation
ACTION_KEY, APPEARANCE_STATE_KEY, APPEARANCE_STREAM_DOWN_KEY, APPEARANCE_STREAM_KEY, APPEARANCE_STREAM_NORMAL_KEY, APPEARANCE_STREAM_ROLLOVER_KEY, bbox, BBOX_VALUE, border, BORDER_DASH, BORDER_HORIZONTAL_CORNER_RADIUS, BORDER_KEY, BORDER_STYLE_KEY, BORDER_VERTICAL_CORNER_RADIUS, BORDER_WIDTH, borderStyle, canDrawBorder, color, COLOR_KEY, compressAppearanceStream, content, CONTENTS_KEY, FLAG_HIDDEN, FLAG_INVISIBLE, FLAG_KEY, FLAG_LOCKED, FLAG_LOCKED_CONTENTS, FLAG_NO_ROTATE, FLAG_NO_VIEW, FLAG_NO_ZOOM, FLAG_PRINT, FLAG_READ_ONLY, FLAG_TOGGLE_NO_VIEW, hasBlendingMode, INVISIBLE_RECTANGLE, M_KEY, matrix, modifiedDate, NM_KEY, PARENT_KEY, PARENT_PAGE_KEY, RECTANGLE_KEY, RESOURCES_VALUE, securityManager, shapes, subtype, SUBTYPE_CIRCLE, SUBTYPE_FREE_TEXT, SUBTYPE_HIGHLIGHT, SUBTYPE_INK, SUBTYPE_LINE, SUBTYPE_LINK, SUBTYPE_POLYGON, SUBTYPE_POLYLINE, SUBTYPE_POPUP, SUBTYPE_SQUARE, SUBTYPE_TEXT, SUBTYPE_WIDGET, TYPE, TYPE_VALUE, userSpaceRectangle, VISIBLE_RECTANGLE
 
Fields inherited from class org.icepdf.core.pobjects.Dictionary
entries, FORM_TYPE_KEY, inited, isDeleted, isNew, LENGTH_KEY, library, SUBTYPE_KEY, TYPE_KEY
 
Constructor Summary
TextAnnotation(Library l, java.util.HashMap h)
           
 
Method Summary
 Name getIconName()
           
static TextAnnotation getInstance(Library library, java.awt.Rectangle rect)
          Gets an instance of a TextAnnotation that has valid Object Reference.
 java.lang.String getState()
           
 java.lang.String getStateModel()
           
 void init()
          Initiate the Dictionary.
 boolean isOpen()
           
 void resetAppearanceStream(double dx, double dy, java.awt.geom.AffineTransform pageTransform)
          Resets the annotations appearance stream.
 void setIconName(Name iconName)
           
 void setOpen(boolean open)
           
 void setState(java.lang.String state)
           
 void setStateModel(java.lang.String stateModel)
           
 
Methods inherited from class org.icepdf.core.pobjects.annotations.MarkupAnnotation
getCreationDate, getInReplyToAnnotation, getIntent, getOpacity, getPopupAnnotation, getReplyToRelation, getRichText, getSubject, getTitleText, setCreationDate, setInReplyToAnnotation, setPopupAnnotation, setRichText, setSubject, setTitleText, toString
 
Methods inherited from class org.icepdf.core.pobjects.annotations.Annotation
addAction, allowAlterProperties, allowPrintNormalMode, allowScreenDownMode, allowScreenNormalMode, allowScreenOrPrintRenderingOrInteraction, allowScreenRolloverMode, buildAnnotation, deleteAction, deriveDrawingRectangle, getAction, getAppearanceStream, getBbox, getBorder, getBorderStyle, getBorderStyleStroke, getBorderType, getColor, getContents, getFlagHidden, getFlagInvisible, getFlagLocked, getFlagLockedContents, getFlagNoRotate, getFlagNoView, getFlagNoZoom, getFlagPrint, getFlagReadOnly, getFlagToggleNoView, getLineStyle, getLineThickness, getPage, getParentAnnotation, getShapes, getSubType, getUserSpaceRectangle, hasAppearanceStream, isBorder, isSupportedAnnotationType, render, renderAppearanceStream, renderBorder, renderBorderTabSelected, resetAppearanceStream, setBBox, setBorderStyle, setColor, setCompressAppearanceStream, setContents, setFlag, setModifiedDate, setSubtype, setUserSpaceRectangle, syncBBoxToUserSpaceRectangle, updateAction
 
Methods inherited from class org.icepdf.core.pobjects.Dictionary
getEntries, getFloat, getInt, getLibrary, getNumber, getObject, getPObjectReference, isDeleted, isNew, setDeleted, setNew, setPObjectReference
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

OPEN_KEY

public static final Name OPEN_KEY
(Optional) A flag specifying whether the annotation shall initially be displayed open. Default value: false (closed).


NAME_KEY

public static final Name NAME_KEY
Optional) The name of an icon that shall be used in displaying the annotation. Conforming readers shall provide predefined icon appearances for at least the following standard names:

Comment, Key, Note, Help, NewParagraph, Paragraph, Insert

Additional names may be supported as well. Default value: Note.

The annotation dictionary’s AP entry, if present, shall take precedence over the Name entry; see Table 168 and 12.5.5, “Appearance Streams.�


STATE_KEY

public static final Name STATE_KEY
(Optional; PDF 1.5) The state to which the original annotation shall be set; see 12.5.6.3, “Annotation States.�

Default: “Unmarked� if StateModel is “Marked�; “None� if StateModel is “Review�.


STATE_MODEL_KEY

public static final Name STATE_MODEL_KEY
(Required if State is present, otherwise optional; PDF 1.5) The state model corresponding to State; see 12.5.6.3, “Annotation States.�


COMMENT_ICON

public static final Name COMMENT_ICON
Named text icon times.


CHECK_ICON

public static final Name CHECK_ICON

CHECK_MARK_ICON

public static final Name CHECK_MARK_ICON

CIRCLE_ICON

public static final Name CIRCLE_ICON

CROSS_ICON

public static final Name CROSS_ICON

CROSS_HAIRS_ICON

public static final Name CROSS_HAIRS_ICON

HELP_ICON

public static final Name HELP_ICON

INSERT_ICON

public static final Name INSERT_ICON

KEY_ICON

public static final Name KEY_ICON

NEW_PARAGRAPH_ICON

public static final Name NEW_PARAGRAPH_ICON

PARAGRAPH_ICON

public static final Name PARAGRAPH_ICON

RIGHT_ARROW_ICON

public static final Name RIGHT_ARROW_ICON

RIGHT_POINTER_ICON

public static final Name RIGHT_POINTER_ICON

STAR_ICON

public static final Name STAR_ICON

UP_ARROW_ICON

public static final Name UP_ARROW_ICON

UP_LEFT_ARROW_ICON

public static final Name UP_LEFT_ARROW_ICON

STATE_MODEL_MARKED

public static final java.lang.String STATE_MODEL_MARKED
State Models

See Also:
Constant Field Values

STATE_MODEL_REVIEW

public static final java.lang.String STATE_MODEL_REVIEW
See Also:
Constant Field Values

STATE_MARKED

public static final java.lang.String STATE_MARKED
State names.

See Also:
Constant Field Values

STATE_UNMARKED

public static final java.lang.String STATE_UNMARKED
See Also:
Constant Field Values

STATE_ACCEPTED

public static final java.lang.String STATE_ACCEPTED
See Also:
Constant Field Values

STATE_REJECTED

public static final java.lang.String STATE_REJECTED
See Also:
Constant Field Values

STATE_CANCELLED

public static final java.lang.String STATE_CANCELLED
See Also:
Constant Field Values

STATE_COMPLETED

public static final java.lang.String STATE_COMPLETED
See Also:
Constant Field Values

STATE_REVIEW_NONE

public static final java.lang.String STATE_REVIEW_NONE
See Also:
Constant Field Values

open

protected boolean open

iconName

protected Name iconName

state

protected java.lang.String state

stateModel

protected java.lang.String stateModel

COMMENT_CONTENT_STREAM

public static final java.lang.String COMMENT_CONTENT_STREAM
See Also:
Constant Field Values

CHECK_CONTENT_STREAM

public static final java.lang.String CHECK_CONTENT_STREAM
See Also:
Constant Field Values

CHECK_MARK_CONTENT_STREAM

public static final java.lang.String CHECK_MARK_CONTENT_STREAM
See Also:
Constant Field Values

CIRCLE_CONTENT_STREAM

public static final java.lang.String CIRCLE_CONTENT_STREAM
See Also:
Constant Field Values

CROSS_CONTENT_STREAM

public static final java.lang.String CROSS_CONTENT_STREAM
See Also:
Constant Field Values

CROSS_HAIRS_CONTENT_STREAM

public static final java.lang.String CROSS_HAIRS_CONTENT_STREAM
See Also:
Constant Field Values

HELP_CONTENT_STREAM

public static final java.lang.String HELP_CONTENT_STREAM
See Also:
Constant Field Values

INSERT_CONTENT_STREAM

public static final java.lang.String INSERT_CONTENT_STREAM
See Also:
Constant Field Values

KEY_CONTENT_STREAM

public static final java.lang.String KEY_CONTENT_STREAM
See Also:
Constant Field Values

NEW_PARAGRAPH_CONTENT_STREAM

public static final java.lang.String NEW_PARAGRAPH_CONTENT_STREAM
See Also:
Constant Field Values

PARAGRAPH_CONTENT_STREAM

public static final java.lang.String PARAGRAPH_CONTENT_STREAM
See Also:
Constant Field Values

RIGHT_ARROW_CONTENT_STREAM

public static final java.lang.String RIGHT_ARROW_CONTENT_STREAM
See Also:
Constant Field Values

RIGHT_POINTER_CONTENT_STREAM

public static final java.lang.String RIGHT_POINTER_CONTENT_STREAM
See Also:
Constant Field Values

STAR_CONTENT_STREAM

public static final java.lang.String STAR_CONTENT_STREAM
See Also:
Constant Field Values

UP_ARROW_CONTENT_STREAM

public static final java.lang.String UP_ARROW_CONTENT_STREAM
See Also:
Constant Field Values

UP_LEFT_ARROW_CONTENT_STREAM

public static final java.lang.String UP_LEFT_ARROW_CONTENT_STREAM
See Also:
Constant Field Values
Constructor Detail

TextAnnotation

public TextAnnotation(Library l,
                      java.util.HashMap h)
Method Detail

init

public void init()
Description copied from class: Dictionary
Initiate the Dictionary. Retrieve any needed attributes.

Overrides:
init in class MarkupAnnotation

getInstance

public static TextAnnotation getInstance(Library library,
                                         java.awt.Rectangle rect)
Gets an instance of a TextAnnotation that has valid Object Reference.

Parameters:
library - document library
rect - bounding rectangle in user space
Returns:
new TextAnnotation Instance.

resetAppearanceStream

public void resetAppearanceStream(double dx,
                                  double dy,
                                  java.awt.geom.AffineTransform pageTransform)
Resets the annotations appearance stream.

Specified by:
resetAppearanceStream in class Annotation

isOpen

public boolean isOpen()

getIconName

public Name getIconName()

getState

public java.lang.String getState()

getStateModel

public java.lang.String getStateModel()

setOpen

public void setOpen(boolean open)

setIconName

public void setIconName(Name iconName)

setState

public void setState(java.lang.String state)

setStateModel

public void setStateModel(java.lang.String stateModel)