Class PDAnnotationText
- java.lang.Object
-
- com.tom_roush.pdfbox.pdmodel.interactive.annotation.PDAnnotation
-
- com.tom_roush.pdfbox.pdmodel.interactive.annotation.PDAnnotationMarkup
-
- com.tom_roush.pdfbox.pdmodel.interactive.annotation.PDAnnotationText
-
- All Implemented Interfaces:
COSObjectable
public class PDAnnotationText extends PDAnnotationMarkup
This is the class that represents a text annotation.
-
-
Field Summary
Fields Modifier and Type Field Description static StringNAME_COMMENTConstant for the name of a text annotation.static StringNAME_HELPConstant for the name of a text annotation.static StringNAME_INSERTConstant for the name of a text annotation.static StringNAME_KEYConstant for the name of a text annotation.static StringNAME_NEW_PARAGRAPHConstant for the name of a text annotation.static StringNAME_NOTEConstant for the name of a text annotation.static StringNAME_PARAGRAPHConstant for the name of a text annotation.static StringSUB_TYPEThe type of annotation.-
Fields inherited from class com.tom_roush.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
-
-
Constructor Summary
Constructors Constructor Description PDAnnotationText()Constructor.PDAnnotationText(COSDictionary field)Creates a Text annotation from a COSDictionary, expected to be a correct object definition.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetName()This will retrieve the name (and hence appearance, AP taking precedence) For this annotation.booleangetOpen()This will retrieve the initial state of the annotation, open Or closed (default closed).StringgetState()This will retrieve the annotation state.StringgetStateModel()This will retrieve the annotation state model.voidsetName(String name)This will set the name (and hence appearance, AP taking precedence) For this annotation.voidsetOpen(boolean open)This will set initial state of the annotation, open or closed.voidsetState(String state)This will set the annotation state.voidsetStateModel(String stateModel)This will set the annotation state model.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from class com.tom_roush.pdfbox.pdmodel.interactive.annotation.PDAnnotation
createAnnotation, getAnnotationFlags, getAnnotationName, getAppearance, getAppearanceState, getColor, getColor, getContents, getCOSObject, getModifiedDate, getNormalAppearanceStream, getPage, getRectangle, getStructParent, getSubtype, isHidden, isInvisible, isLocked, isNoRotate, isNoView, isNoZoom, isPrinted, isReadOnly, isToggleNoView, setAnnotationFlags, setAnnotationName, setAppearance, setAppearanceState, setColor, setContents, setHidden, setInvisible, setLocked, setModifiedDate, setNoRotate, setNoView, setNoZoom, setPage, setPrinted, setReadOnly, setRectangle, setStructParent, setToggleNoView
-
Methods inherited from class com.tom_roush.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
-
-
-
-
Field Detail
-
NAME_COMMENT
public static final String NAME_COMMENT
Constant for the name of a text annotation.- See Also:
- Constant Field Values
-
NAME_KEY
public static final String NAME_KEY
Constant for the name of a text annotation.- See Also:
- Constant Field Values
-
NAME_NOTE
public static final String NAME_NOTE
Constant for the name of a text annotation.- See Also:
- Constant Field Values
-
NAME_HELP
public static final String NAME_HELP
Constant for the name of a text annotation.- See Also:
- Constant Field Values
-
NAME_NEW_PARAGRAPH
public static final String NAME_NEW_PARAGRAPH
Constant for the name of a text annotation.- See Also:
- Constant Field Values
-
NAME_PARAGRAPH
public static final String NAME_PARAGRAPH
Constant for the name of a text annotation.- See Also:
- Constant Field Values
-
NAME_INSERT
public static final String NAME_INSERT
Constant for the name of a text annotation.- See Also:
- Constant Field Values
-
SUB_TYPE
public static final String SUB_TYPE
The type of annotation.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PDAnnotationText
public PDAnnotationText()
Constructor.
-
PDAnnotationText
public PDAnnotationText(COSDictionary field)
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 Detail
-
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
public void setName(String name)
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
public String 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
public String getState()
This will retrieve the annotation state.- Returns:
- the annotation state
-
setState
public void setState(String state)
This will set the annotation state.- Parameters:
state- the annotation state
-
getStateModel
public String getStateModel()
This will retrieve the annotation state model.- Returns:
- the annotation state model
-
setStateModel
public void setStateModel(String stateModel)
This will set the annotation state model. Allowed values are "Marked" and "Review"- Parameters:
stateModel- the annotation state model
-
-