public class FreeText extends Markup
Annot.BorderStyle
Modifier and Type | Field and Description |
---|---|
static int |
e_FreeText
This integer list spedifies the intention of the FreeText annotation
e_FreeText - The annotation ntended to function as a plain free-text annotation.
|
static int |
e_FreeTextCallout
The Constant e_FreeTextCallout.
|
static int |
e_FreeTextTypeWriter
The Constant e_FreeTextTypeWriter.
|
static int |
e_Unknown
The Constant e_Unknown.
|
e_3D, e_action_trigger_activate, e_action_trigger_annot_blur, e_action_trigger_annot_down, e_action_trigger_annot_enter, e_action_trigger_annot_exit, e_action_trigger_annot_focus, e_action_trigger_annot_page_close, e_action_trigger_annot_page_invisible, e_action_trigger_annot_page_open, e_action_trigger_annot_page_visible, e_action_trigger_annot_up, e_Caret, e_Circle, e_down, e_FileAttachment, e_hidden, e_Highlight, e_Ink, e_invisible, e_Line, e_Link, e_locked, e_locked_contents, e_Movie, e_no_rotate, e_no_view, e_no_zoom, e_normal, e_Polygon, e_Polyline, e_Popup, e_print, e_PrinterMark, e_Projection, e_read_only, e_Redact, e_RichMedia, e_rollover, e_Screen, e_Sound, e_Square, e_Squiggly, e_Stamp, e_StrikeOut, e_Text, e_toggle_no_view, e_TrapNet, e_Underline, e_Watermark, e_Widget
Constructor and Description |
---|
FreeText()
Creates an empty FreeText annotation.
|
FreeText(Annot annot)
Creates an FreeText annotation and initialize it using given annotation object.
|
FreeText(Obj d)
Creates an FreeText annotation and initialize it using given Cos/SDF object.
|
Modifier and Type | Method and Description |
---|---|
static FreeText |
create(Doc doc,
Rect pos)
Creates a new FreeText annotation, in the specified document.
|
Point |
getCalloutLinePoint1()
Get p1 of the callout line points of the FreeText annotation.
|
Point |
getCalloutLinePoint2()
Get p2 of the callout line points of the FreeText annotation.
|
Point |
getCalloutLinePoint3()
Get p3 of the callout line points of the FreeText annotation.
|
java.lang.String |
getDefaultAppearance()
Get the default appearance of the FreeText annotation.
|
int |
getEndingStyle()
Get the ending style of the callout line of the FreeText Annotation.
|
double |
getFontSize()
Returns the font size of the FreeText Annotation.
|
int |
getIntentName()
Get the Intent name as an entry from the enum "IntentName"
of the annnotation type.
|
ColorPt |
getLineColor()
Returns the line and border color of the FreeText Annotation.
|
int |
getLineColorCompNum()
Returns the number of color components in the line and border color
of the FreeText Annotation.
|
int |
getQuaddingFormat()
Get the quading format of the FreeText annotation.
|
ColorPt |
getTextColor()
Returns the text color of the FreeText Annotation.
|
int |
getTextColorCompNum()
Returns the number of color components in the line and border color
of the FreeText Annotation.
|
void |
setCalloutLinePoints(Point p1,
Point p2,
Point p3)
Set the callout line points of the FreeText annotation.
|
void |
setDefaultAppearance(java.lang.String app_str)
Set the default appearance of the FreeText annotation.
|
void |
setEndingStyle(int est)
Set the ending style of the callout line of the FreeText Annotation.
|
void |
setEndingStyle(java.lang.String est)
Set the ending style of the callout line of the FreeText Annotation.
|
void |
setFontSize(double font_size)
Sets the font size of the FreeText Annotation.
|
void |
setIntentName(int mode)
Set the Intent name as an entry from the enum "IntentName"
of the annnotation type.
|
void |
setLineColor(ColorPt color,
int col_comp)
Set the line and border color of the FreeText Annotation.
|
void |
setQuaddingFormat(int app_qform)
Set the quading format of the FreeText annotation.
|
void |
setTextColor(ColorPt color,
int col_comp)
Set the text color of the FreeText Annotation.
|
getBorderEffect, getBorderEffectIntensity, getContentRect, getCreationDates, getInteriorColor, getInteriorColorCompNum, getOpacity, getPadding, getPopup, getSubject, getTitle, setBorderEffect, SetBorderEffectIntensity, setContentRect, setCreationDates, setInteriorColor, setOpacity, SetPadding, setPopup, setSubject, setTitle
__Create, __GetHandle, __GetRefHandle, create, equals, flatten, getActiveAppearanceState, getAppearance, getAppearance, getAppearance, getBorderStyle, getColorAsCMYK, getColorAsGray, getColorAsRGB, getColorCompNum, getContents, getDate, getFlag, getOptionalContent, getPage, getRect, getRotation, getSDFObj, GetStructParent, getTriggerAction, getType, getUniqueID, getVisibleContentBox, isMarkup, isValid, refreshAppearance, removeAppearance, resize, setActiveAppearanceState, setAppearance, setAppearance, setAppearance, setBorderStyle, setColor, setContents, setDate, setFlag, setOptionalContent, setPage, setRect, setRotation, setStructParent, setUniqueID
public static final int e_FreeText
public static final int e_FreeTextCallout
public static final int e_FreeTextTypeWriter
public static final int e_Unknown
public FreeText(Obj d)
Note: The constructor does not copy any data, but is instead the logical equivalent of a type cast.
d
- input Cos/SDF objectpublic FreeText()
public FreeText(Annot annot) throws PDFNetException
Note: The constructor does not copy any data, but is instead the logical equivalent of a type cast.
annot
- input annotation objectPDFNetException
public static FreeText create(Doc doc, Rect pos) throws PDFNetException
doc
- A document to which the FreeText annotation is added.pos
- A rectangle specifying the FreeText annotation's bounds, specified in
user space coordinates.PDFNetException
public java.lang.String getDefaultAppearance() throws PDFNetException
Note: The default appearance string shall be used in formatting the text.The annotation dictionary's Appearance (AP) entry, if present, shall take precedence over this entry.
PDFNetException
public void setDefaultAppearance(java.lang.String app_str) throws PDFNetException
Note: The default appearance string shall be used in formatting the text.The annotation dictionary's Appearance (AP) entry, if present, shall take precedence over this entry.
app_str
- A string representing the default appearance of the FreeText annotation.PDFNetException
public int getQuaddingFormat() throws PDFNetException
Note: The int code specifies the form of quadding (justification) that shall be used in displaying the annotation's text: 0Left-justified 1Centered 2Right-justified Default value: 0 (left-justified).
PDFNetException
public void setQuaddingFormat(int app_qform) throws PDFNetException
Note: The int code specifies the form of quadding (justification) that shall be used in displaying the annotation's text:
app_qform
- the new quadding formatPDFNetException
public Point getCalloutLinePoint1() throws PDFNetException
Note: The returning values are two or three Point objects specifying a callout line attached to the free text annotation. Three Point objects represent the starting, knee point, and ending coordinates of the line in default user space, two Point objects represent the starting and ending coordinates of the line.
If the line is straight, i.e. only has two points, two valid points will be returned in p1 and p2, the p3 will be a point with negative x and y coordinate values.
PDFNetException
public Point getCalloutLinePoint2() throws PDFNetException
Note: The returning values are two or three Point objects specifying a callout line attached to the free text annotation. Three Point objects represent the starting, knee point, and ending coordinates of the line in default user space, two Point objects represent the starting and ending coordinates of the line.
If the line is straight, i.e. only has two points, two valid points will be returned in p1 and p2, the p3 will be a point with negative x and y coordinate values.
PDFNetException
public Point getCalloutLinePoint3() throws PDFNetException
Note: The returning values are two or three Point objects specifying a callout line attached to the free text annotation. Three Point objects represent the starting, knee point, and ending coordinates of the line in default user space, two Point objects represent the starting and ending coordinates of the line.
If the line is straight, i.e. only has two points, two valid points will be returned in p1 and p2, the p3 will be a point with negative x and y coordinate values.
PDFNetException
public void setCalloutLinePoints(Point p1, Point p2, Point p3) throws PDFNetException
Note: The three Point objects specify a callout line attached to the free text annotation. The three Point objects represent the starting, knee point, and ending coordinates of the line in default user space.
p1
- The staring point.p2
- The ending point.p3
- The kee point.PDFNetException
public int getIntentName() throws PDFNetException
Note: The intent name describes the intent of the free text annotation. The following values shall be valid: e_FreeText - The annotation is intended to function as a plain free-text annotation. A plain free-text annotation is also known as a text box comment. e_FreeTextCallout - The annotation is intended to function as a callout. The callout is associated with an area on the page through the callout line specified in CL. e_FreeTextTypeWriter - The annotation is intended to function as a click-to-type or typewriter object and no callout line is drawn. Default value: e_FreeText
PDFNetException
public void setIntentName(int mode) throws PDFNetException
Note: The intent name describes the intent of the free text annotation. The following values shall be valid: e_FreeText - The annotation is intended to function as a plain free-text annotation. A plain free - text annotation is also known as a text box comment. e_FreeTextCallout - The annotation is intended to function as a callout. The callout is associated with an area on the page through the callout line specified in CL. e_FreeTextTypeWriter - The annotation is intended to function as a click-to-type or typewriter object and no callout line is drawn. Default value: e_FreeText
mode
- The intent name of the annotation as
an entry from the enum "IntentJName".PDFNetException
public int getEndingStyle() throws PDFNetException
Note: The ending style specifies the line ending style that shall be used in drawing the callout line specified in CallOut Line Points (CL). The enum entry shall specify the line ending style for the endpoint defined by the starting point(p1) of the CallOut Line Points. Default value: e_None.
PDFNetException
public void setEndingStyle(int est) throws PDFNetException
Note: The ending style specifies the line ending style that shall be used in drawing the callout line specified in CallOut Line Points (CL). The enum entry shall specify the line ending style for the endpoint defined by the starting point(p1) of the CallOut Line Points. Default value: e_None.
est
- The ending style represented using one of the
entries of the enum "EndingStyle"PDFNetException
public void setEndingStyle(java.lang.String est) throws PDFNetException
Note: The ending style specifies the line ending style that shall be used in drawing the callout line specified in CallOut Line Points (CL). The enum entry shall specify the line ending style for the endpoint defined by the starting point(p1) of the CallOut Line Points. Default value: "None".
est
- The ending style represented using a string.PDFNetException
public void setTextColor(ColorPt color, int col_comp) throws PDFNetException
Note: Current implementation of this method creates a non-standard entry in the annotation dictionary and uses it to generate the appearance stream. Make sure you call RefreshAppearance() after changing text or line color, and remember that editing the annotation in other PDF application will produce different appearance.
color
- ColorPt object representing the color.col_comp
- number of colorant components in ColorPt object.PDFNetException
public ColorPt getTextColor() throws PDFNetException
Note: Current implementation of this method uses a non-standard entry in the annotation dictionary and will not return meaningful results when called on annotations not created with PDFTron software.
PDFNetException
public int getTextColorCompNum() throws PDFNetException
PDFNetException
public void setLineColor(ColorPt color, int col_comp) throws PDFNetException
Note: Current implementation of this method creates a non-standard entry in the annotation dictionary and uses it to generate the appearance stream. Make sure you call RefreshAppearance() after changing text or line color, and remember that editing the annotation in other PDF application will produce different appearance.
color
- ColorPt object representing the color.col_comp
- number of colorant components in ColorPt object.PDFNetException
public ColorPt getLineColor() throws PDFNetException
Note: Current implementation of this method uses a non-standard entry in the annotation dictionary and will not return meaningful results when called on annotations not created with PDFTron software.
PDFNetException
public int getLineColorCompNum() throws PDFNetException
PDFNetException
public void setFontSize(double font_size) throws PDFNetException
font_size
- font sizePDFNetException
public double getFontSize() throws PDFNetException
PDFNetException