Class PDAnnotationText
java.lang.Object
org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation
org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationMarkup
org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationText
- All Implemented Interfaces:
COSObjectable
This is the class that represents a text annotation.
- Version:
- $Revision: 1.1 $
- Author:
- Paul King
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Constant for the name of a text annotation.static final String
Constant for the name of a text annotation.static final String
Constant for the name of a text annotation.static final String
Constant for the name of a text annotation.static final String
Constant for the name of a text annotation.static final String
Constant for the name of a text annotation.static final String
Constant for the name of a text annotation.static final String
The type of annotation.Fields inherited from class org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationMarkup
RT_GROUP, RT_REPLY, SUB_TYPE_CARET, SUB_TYPE_FREETEXT, SUB_TYPE_INK, SUB_TYPE_POLYGON, SUB_TYPE_POLYLINE, SUB_TYPE_SOUND
Fields inherited from class org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation
FLAG_HIDDEN, FLAG_INVISIBLE, FLAG_LOCKED, FLAG_NO_ROTATE, FLAG_NO_VIEW, FLAG_NO_ZOOM, FLAG_PRINTED, FLAG_READ_ONLY, FLAG_TOGGLE_NO_VIEW
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor.PDAnnotationText
(COSDictionary field) Creates a Text annotation from a COSDictionary, expected to be a correct object definition. -
Method Summary
Modifier and TypeMethodDescriptiongetName()
This will retrieve the name (and hence appearance, AP taking precedence) For this annotation.boolean
getOpen()
This will retrieve the initial state of the annotation, open Or closed (default closed).getState()
This will retrieve the annotation state.This will retrieve the annotation state model.void
This will set the name (and hence appearance, AP taking precedence) For this annotation.void
setOpen
(boolean open) This will set initial state of the annotation, open or closed.void
This will set the annotation state.void
setStateModel
(String stateModel) This will set the annotation state model.Methods inherited from class org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationMarkup
getConstantOpacity, getCreationDate, getExternalData, getInReplyTo, getIntent, getPopup, getReplyType, getRichContents, getSubject, getTitlePopup, setConstantOpacity, setCreationDate, setExternalData, setInReplyTo, setIntent, setPopup, setReplyType, setRichContents, setSubject, setTitlePopup
Methods inherited from class org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation
createAnnotation, getAnnotationFlags, getAnnotationName, getAppearance, getAppearanceStream, getColour, getContents, getCOSObject, getDictionary, getModifiedDate, getPage, getRectangle, getStructParent, getSubtype, isHidden, isInvisible, isLocked, isNoRotate, isNoView, isNoZoom, isPrinted, isReadOnly, isToggleNoView, setAnnotationFlags, setAnnotationName, setAppearance, setAppearanceStream, setColour, setContents, setHidden, setInvisible, setLocked, setModifiedDate, setModifiedDate, setNoRotate, setNoView, setNoZoom, setPage, setPrinted, setReadOnly, setRectangle, setStructParent, setToggleNoView
-
Field Details
-
NAME_COMMENT
Constant for the name of a text annotation.- See Also:
-
NAME_KEY
Constant for the name of a text annotation.- See Also:
-
NAME_NOTE
Constant for the name of a text annotation.- See Also:
-
NAME_HELP
Constant for the name of a text annotation.- See Also:
-
NAME_NEW_PARAGRAPH
Constant for the name of a text annotation.- See Also:
-
NAME_PARAGRAPH
Constant for the name of a text annotation.- See Also:
-
NAME_INSERT
Constant for the name of a text annotation.- See Also:
-
SUB_TYPE
The type of annotation.- See Also:
-
-
Constructor Details
-
PDAnnotationText
public PDAnnotationText()Constructor. -
PDAnnotationText
Creates a Text annotation from a COSDictionary, expected to be a correct object definition.- Parameters:
field
- the PDF object to represent as a field.
-
-
Method Details
-
setOpen
public void setOpen(boolean open) This will set initial state of the annotation, open or closed.- Parameters:
open
- Boolean value, true = open false = closed
-
getOpen
public boolean getOpen()This will retrieve the initial state of the annotation, open Or closed (default closed).- Returns:
- The initial state, true = open false = closed
-
setName
This will set the name (and hence appearance, AP taking precedence) For this annotation. See the NAME_XXX constants for valid values.- Parameters:
name
- The name of the annotation
-
getName
This will retrieve the name (and hence appearance, AP taking precedence) For this annotation. The default is NOTE.- Returns:
- The name of this annotation, see the NAME_XXX constants.
-
getState
This will retrieve the annotation state.- Returns:
- the annotation state
-
setState
This will set the annotation state.- Parameters:
state
- the annotation state
-
getStateModel
This will retrieve the annotation state model.- Returns:
- the annotation state model
-
setStateModel
This will set the annotation state model. Allowed values are "Marked" and "Review"- Parameters:
stateModel
- the annotation state model
-