new FreeTextAnnot()
A FreeText annotation (PDF 1.3) displays text directly on the page.
Unlike an ordinary Text annotation, a FreeText annotation has no
open or closed state; The content of the FreeText annotation is always
visible instead of being displayed in a popup window.
Extends
- MarkupAnnot
Members
-
<static> IntentName
-
Properties:
Name Type Description e_FreeText
number e_FreeTextCallout
number e_FreeTextTypeWriter
number e_Unknown
number
Methods
-
<static> create(doc, pos)
-
Creates a new FreeText annotation in the specified document.
Parameters:
Name Type Description doc
PDFNet.PDFDoc | PDFNet.SDFDoc | PDFNet.FDFDoc A document to which the FreeText annotation is added. pos
PDFNet.Rect A rectangle specifying the FreeText annotation's bounds in default user space units. Returns:
A promise that resolves to a newly created blank FreeText annotation.- Type
- Promise.<PDFNet.FreeTextAnnot>
-
<static> createFromAnnot(ann)
-
creates a FreeText annotation and initializes it using given annotation object.
Parameters:
Name Type Description ann
PDFNet.Annot Annot object used to initialize the FreeText annotation. Returns:
A promise that resolves to an object of type: "PDFNet.FreeTextAnnot"- Type
- Promise.<PDFNet.FreeTextAnnot>
-
<static> createFromObj( [d])
-
creates a FreeText annotation and initializes it using given Cos/SDF object.
Parameters:
Name Type Argument Description d
PDFNet.Obj <optional>
The Cos/SDF object to initialze the annotation with. Returns:
A promise that resolves to an object of type: "PDFNet.FreeTextAnnot"- Type
- Promise.<PDFNet.FreeTextAnnot>
-
getCalloutLinePoints(p1, p2, p3)
-
Parameters:
Name Type Description p1
PDFNet.Point p2
PDFNet.Point p3
PDFNet.Point Returns:
- Type
- Promise.<void>
-
getDefaultAppearance()
-
Returns the default appearance of the FreeText annotation.
Returns:
A promise that resolves to a string representing the default appearance of the annotation.- Type
- Promise.<string>
-
getEndingStyle()
-
Returns the ending style of the callout line of the FreeText Annotation.
Returns:
A promise that resolves to the ending style represented as one of the entries of the enum "EndingStyle"- Type
- Promise.<number>
Example
Return value enum: <pre> PDFNet.LineAnnot.EndingStyle = { e_Square : 0 e_Circle : 1 e_Diamond : 2 e_OpenArrow : 3 e_ClosedArrow : 4 e_Butt : 5 e_ROpenArrow : 6 e_RClosedArrow : 7 e_Slash : 8 e_None : 9 e_Unknown : 10 } </pre>
-
getFontSize()
-
Get the default appearance font size. To get the actual font size used, call RefreshAppearance and then use ElementReader on the content stream of this annotation.
Returns:
A promise that resolves to the default font size, where a value of zero indicates auto sizing.- Type
- Promise.<number>
-
getIntentName()
-
Returns Intent name of the FreeText annotation. (PDF 1.4)
Returns:
A promise that resolves to the intent name of the annotation as an entry from the enum "IntentName".- Type
- Promise.<number>
Example
Return value enum: <pre> PDFNet.FreeTextAnnot.IntentName = { e_FreeText : 0 e_FreeTextCallout : 1 e_FreeTextTypeWriter : 2 e_Unknown : 3 } </pre>
-
getLineColor(col_comp)
-
Parameters:
Name Type Description col_comp
number Returns:
- Type
- Promise.<void>
-
getQuaddingFormat()
-
Returns the quading format of the FreeText annotation. (PDF 1.4)
Returns:
A promise that resolves to a int (code) indicating the quading format of the FreeText annotation.- Type
- Promise.<number>
-
getTextColor(col_comp)
-
Parameters:
Name Type Description col_comp
number Returns:
- Type
- Promise.<void>
-
setCalloutLinePoints(p1, p2, p3)
-
sets the callout line points of the FreeText annotation. (Optional; meaningful only if IT is FreeTextCallout; PDF 1.6)
Parameters:
Name Type Description p1
PDFNet.Point The target point. (where the ending style is used) p2
PDFNet.Point The knee point. p3
PDFNet.Point The ending point. Returns:
- Type
- Promise.<void>
-
setCalloutLinePointsTwo(p1, p2)
-
sets the callout line points of the FreeText annotation. (Optional; meaningful only if IT is FreeTextCallout; PDF 1.6)
Parameters:
Name Type Description p1
PDFNet.Point The target point. (where the ending style is used) p2
PDFNet.Point The ending point. Returns:
- Type
- Promise.<void>
-
setDefaultAppearance(app_str)
-
sets the default appearance of the FreeText annotation.
Parameters:
Name Type Description app_str
string A string representing the default appearance of the annotation. Returns:
- Type
- Promise.<void>
-
setEndingStyle(style)
-
Sets the ending style of the callout line of the FreeText Annotation. (Optional; meaningful only if CL is present; PDF 1.6)
Parameters:
Name Type Description style
number PDFNet.LineAnnot.EndingStyle = { e_Square : 0 e_Circle : 1 e_Diamond : 2 e_OpenArrow : 3 e_ClosedArrow : 4 e_Butt : 5 e_ROpenArrow : 6 e_RClosedArrow : 7 e_Slash : 8 e_None : 9 e_Unknown : 10 }
The ending style represented using one of the entries of the enum "EndingStyle"Returns:
- Type
- Promise.<void>
-
setEndingStyleName(est)
-
sets the ending style of the callout line of the FreeText Annotation. (Optional; meaningful only if CL is present; PDF 1.6)
Parameters:
Name Type Description est
string The ending style represented using a string. Returns:
- Type
- Promise.<void>
-
setFontSize(font_size)
-
Sets the default appearance font size. A value of zero specifies that the font size should should adjust so that the text uses as much of the FreeText bounding box as possible.
Parameters:
Name Type Description font_size
number Set the default font size. A value of zero means auto resize font. Returns:
- Type
- Promise.<void>
-
setIntentName( [mode])
-
Sets the Intent name of the FreeText annotation. (Optional; PDF 1.4)
Parameters:
Name Type Argument Description mode
number <optional>
PDFNet.FreeTextAnnot.IntentName = { e_FreeText : 0 e_FreeTextCallout : 1 e_FreeTextTypeWriter : 2 e_Unknown : 3 }
The intent name of the annotation as an entry from the enum "IntentName".Returns:
- Type
- Promise.<void>
-
setIntentNameDefault()
-
Returns:
- Type
- Promise.<void>
-
setLineColor(color, col_comp)
-
sets the line and border color of the FreeText Annotation.
Parameters:
Name Type Description color
PDFNet.ColorPt ColorPt object representing the color. col_comp
number number of colorant components in ColorPt object. Returns:
- Type
- Promise.<void>
-
setQuaddingFormat(format)
-
Sets the quading format of the FreeText annotation. (Optional; PDF 1.4)
Parameters:
Name Type Description format
number A int code indicating the quading format of the FreeText annotation. Default value: 0 (left-justified). Returns:
- Type
- Promise.<void>
-
setTextColor(color, col_comp)
-
sets the text color of the FreeText Annotation.
Parameters:
Name Type Description color
PDFNet.ColorPt ColorPt object representing the color. col_comp
number number of colorant components in ColorPt object. Returns:
- Type
- Promise.<void>