public class PDAnnotationFreeText extends PDAnnotationMarkup
Modifier and Type | Field and Description |
---|---|
static String |
IT_FREE_TEXT
A plain free-text annotation, also known as a text box comment.
|
static String |
IT_FREE_TEXT_CALLOUT
A callout, associated with an area on the page through the callout line specified.
|
static String |
IT_FREE_TEXT_TYPE_WRITER
The annotation is intended to function as a click-to-type or typewriter object.
|
static String |
SUB_TYPE
The type of annotation.
|
RT_GROUP, RT_REPLY
Constructor and Description |
---|
PDAnnotationFreeText() |
PDAnnotationFreeText(COSDictionary field)
Creates a FreeText annotation from a COSDictionary, expected to be a correct object definition.
|
Modifier and Type | Method and Description |
---|---|
void |
constructAppearances()
Create the appearance entry for this annotation.
|
void |
constructAppearances(PDDocument document)
Create the appearance entry for this annotation.
|
PDBorderEffectDictionary |
getBorderEffect()
This will retrieve the border effect dictionary, specifying effects to be applied used in
drawing the line.
|
float[] |
getCallout()
This will get the coordinates of the callout line.
|
String |
getDefaultAppearance()
Get the default appearance.
|
String |
getDefaultStyleString()
Get the default style string.
|
String |
getLineEndingStyle()
This will retrieve the line ending style.
|
int |
getQ()
This will get the 'quadding' or justification of the text to be displayed.
|
PDRectangle |
getRectDifference()
This will get the rectangle difference rectangle.
|
float[] |
getRectDifferences()
This will get the margin between the annotations "outer" rectangle defined by
/Rect and the border.
|
void |
setBorderEffect(PDBorderEffectDictionary be)
This will set the border effect dictionary, specifying effects to be applied when drawing the
line.
|
void |
setCallout(float[] callout)
This will set the coordinates of the callout line.
|
void |
setCustomAppearanceHandler(PDAppearanceHandler appearanceHandler)
Set a custom appearance handler for generating the annotations appearance streams.
|
void |
setDefaultAppearance(String daValue)
Set the default appearance.
|
void |
setDefaultStyleString(String defaultStyleString)
Set the default style string.
|
void |
setLineEndingStyle(String style)
This will set the line ending style.
|
void |
setQ(int q)
This will set the quadding/justification of the text.
|
void |
setRectDifference(PDRectangle rd)
This will set the rectangle difference rectangle.
|
void |
setRectDifferences(float difference)
This will set the difference between the annotations "outer" rectangle defined by
/Rect and the border.
|
void |
setRectDifferences(float differenceLeft,
float differenceTop,
float differenceRight,
float differenceBottom)
This will set the difference between the annotations "outer" rectangle defined by
/Rect and the border.
|
getBorderStyle, getConstantOpacity, getCreationDate, getExternalData, getInReplyTo, getIntent, getPopup, getReplyType, getRichContents, getSubject, getTitlePopup, setBorderStyle, setConstantOpacity, setCreationDate, setExternalData, setInReplyTo, setIntent, setPopup, setReplyType, setRichContents, setSubject, setTitlePopup
createAnnotation, equals, getAnnotationFlags, getAnnotationName, getAppearance, getAppearanceState, getBorder, getColor, getColor, getContents, getCOSObject, getModifiedDate, getNormalAppearanceStream, getOptionalContent, getPage, getRectangle, getStructParent, getSubtype, hashCode, isHidden, isInvisible, isLocked, isLockedContents, isNoRotate, isNoView, isNoZoom, isPrinted, isReadOnly, isToggleNoView, setAnnotationFlags, setAnnotationName, setAppearance, setAppearanceState, setBorder, setColor, setContents, setHidden, setInvisible, setLocked, setLockedContents, setModifiedDate, setModifiedDate, setNoRotate, setNoView, setNoZoom, setOptionalContent, setPage, setPrinted, setReadOnly, setRectangle, setStructParent, setSubtype, setToggleNoView
public static final String SUB_TYPE
public static final String IT_FREE_TEXT
public static final String IT_FREE_TEXT_CALLOUT
public static final String IT_FREE_TEXT_TYPE_WRITER
public PDAnnotationFreeText()
public PDAnnotationFreeText(COSDictionary field)
field
- the PDF object to represent as a field.public String getDefaultAppearance()
public void setDefaultAppearance(String daValue)
daValue
- a string describing the default appearance.public String getDefaultStyleString()
public void setDefaultStyleString(String defaultStyleString)
defaultStyleString
- a string describing the default style.public int getQ()
PDVariableText
.public void setQ(int q)
PDVariableText
.q
- The new text justification.public void setRectDifferences(float difference)
This will set an equal difference for all sides
difference
- from the annotations /Rect entrypublic void setRectDifferences(float differenceLeft, float differenceTop, float differenceRight, float differenceBottom)
differenceLeft
- left difference from the annotations /Rect entrydifferenceTop
- top difference from the annotations /Rect entrydifferenceRight
- right difference from the annotations /Rect entrydifferenceBottom
- bottom difference from the annotations /Rect entrypublic float[] getRectDifferences()
public final void setCallout(float[] callout)
callout
- An array of four or six numbers specifying a callout line attached to the free
text annotation. Six numbers [ x1 y1 x2 y2 x3 y3 ] represent the starting, knee point, and
ending coordinates of the line in default user space, four numbers [ x1 y1 x2 y2 ] represent
the starting and ending coordinates of the line.public float[] getCallout()
public final void setLineEndingStyle(String style)
style
- The new style.public String getLineEndingStyle()
public void setBorderEffect(PDBorderEffectDictionary be)
be
- The border effect dictionary to set.public PDBorderEffectDictionary getBorderEffect()
public void setRectDifference(PDRectangle rd)
rd
- the rectangle differencepublic PDRectangle getRectDifference()
public void setCustomAppearanceHandler(PDAppearanceHandler appearanceHandler)
appearanceHandler
- custom appearance handlerpublic void constructAppearances()
PDAnnotation
constructAppearances
in class PDAnnotation
public void constructAppearances(PDDocument document)
PDAnnotation
constructAppearances
in class PDAnnotation
document
- the related documentCopyright © 2002–2025 The Apache Software Foundation. All rights reserved.