Class: PolyLineAnnot

PDFNet. PolyLineAnnot


new PolyLineAnnot()

This header defines classes for the Polygon and PolyLine annotations. Polygon annotations (PDF 1.5) display closed polygons on the page. Such polygons may have any number of vertices connected by straight lines. Polyline annotations (PDF 1.5) are similar to polygons, except that the first and last vertex are not implicitly connected.

Extends

Members


<static> IntentType

Type:
  • number
Properties:
Name Type Description
e_PolygonCloud number
e_PolyLineDimension number
e_PolygonDimension number
e_Unknown number

Methods


<static> create(doc, pos)

Creates a new PolyLine annotation in the specified document.
Parameters:
Name Type Description
doc PDFNet.PDFDoc | PDFNet.SDFDoc | PDFNet.FDFDoc A document to which the PolyLine annotation is added.
pos PDFNet.Rect A rectangle specifying the PolyLine annotation's bounds in default user space units.
Returns:
A promise that resolves to a newly created blank PolyLine annotation.
Type
Promise.<PDFNet.PolyLineAnnot>

<static> createFromAnnot(ann)

Creates a PolyLine annotation and initializes it using given annotation object.
Parameters:
Name Type Description
ann PDFNet.Annot Annot object used to initialize the PolyLine annotation. Note: The constructor does not copy any data, but is instead the logical equivalent of a type cast.
Returns:
A promise that resolves to an object of type: "PDFNet.PolyLineAnnot"
Type
Promise.<PDFNet.PolyLineAnnot>

<static> createFromObj( [d])

Creates a PolyLine 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. Note: The constructor does not copy any data, but is instead the logical equivalent of a type cast.
Returns:
A promise that resolves to an object of type: "PDFNet.PolyLineAnnot"
Type
Promise.<PDFNet.PolyLineAnnot>

compare(d)

Compares two annotations for equality. The comparison will return true only if both annotations share the same underlying SDF/Cos object.
Parameters:
Name Type Description
d PDFNet.Annot Annotation to compare to
Inherited From:
Returns:
A promise that resolves to an object of type: "boolean"
Type
Promise.<boolean>

copy()

Copy Constructor
Inherited From:
Returns:
A promise that resolves to an object of type: "PDFNet.Annot"
Type
Promise.<PDFNet.Annot>

deleteCustomData(key)

Deletes custom data associated with the given key.
Parameters:
Name Type Description
key string The key for which to delete the associated data.
Inherited From:
Returns:
Type
Promise.<void>

flatten(page)

Flatten/Merge the existing annotation appearances with the page content and delete this annotation from a given page. Annotation 'flattening' refers to the operation that changes active annotations (such as markup, widgets, 3D models, etc.) into a static area that is part of the PDF document, just like the other text and images in the document. Note: an alternative approach to set the annotation as read only is using Annot.SetFlag(Annot::e_read_only, true) method. Unlike Annot.SetFlag(...), the result of Flatten() operation can not be programatically reversed.
Parameters:
Name Type Description
page PDFNet.Page
Inherited From:
Returns:
Type
Promise.<void>

getActiveAppearanceState()

Gets the annotation's active appearance state.
Inherited From:
Returns:
A promise that resolves to the name of the active state. The annotation's appearance state, which selects the applicable appearance stream from an appearance subdictionary.
Type
Promise.<string>

getAppearance( [annot_state] [, app_state])

Gets the annotation's appearance for the given combination of annotation and appearance states.
Parameters:
Name Type Argument Description
annot_state number <optional>
PDFNet.Annot.State = {
	e_normal : 0
	e_rollover : 1
	e_down : 2
}
the annotation's appearance state, which selects the applicable appearance stream from the appearance sub-dictionary. An annotation can define as many as three separate appearances: The normal, rollover, and down appearance.
app_state string <optional>
is an optional parameter specifying the appearance state to look for (e.g. "Off", "On", etc). If appearance_state is NULL, the choice between different appearance states is determined by the AS (Appearance State) entry in the annotation dictionary.
Inherited From:
Returns:
A promise that resolves to the appearance stream for this annotation, or NULL if the annotation does not have an appearance for the given combination of annotation and appearance states.
Type
Promise.<PDFNet.Obj>

getBorderEffect()

Inherited From:
Returns:
A promise that resolves to the border effect of the markup annotation. Default value: e_None. Beginning with PDF 1.5, some annotations (square, circle, and polygon) may have a 'BE' entry, which is a border effect dictionary that specifies an effect that shall be applied to the border of the annotations. Beginning with PDF 1.6, the free text annotation may also have a BE entry. Note: When "e_Cloudy" is chosen,the width and dash array specified by the annotation's BorderStyle entry needs to be taken into consideration.
Type
Promise.<number>
Example
Return value enum:
<pre>
PDFNet.MarkupAnnot.BorderEffect = {
	e_None : 0
	e_Cloudy : 1
}
</pre>

getBorderEffectIntensity()

Inherited From:
Returns:
A promise that resolves to a number describing the intensity of the border effect, in the range 0 to 2. Beginning with PDF 1.5, some annotations (square, circle, and polygon) may have a 'BE' entry, which is a border effect dictionary that specifies an effect that shall be applied to the border of the annotations. Beginning with PDF 1.6, the free text annotation may also have a BE entry.
Type
Promise.<number>

getBorderStyle()

Gets the border style for the annotation. Typically used for Link annotations.
Inherited From:
Returns:
A promise that resolves to annotation's border style.
Type
Promise.<PDFNet.AnnotBorderStyle>

getCapPos()

Inherited From:
Returns:
A promise that resolves to an object of type: "number"
PDFNet.LineAnnot.CapPos = {
	e_Inline : 0
	e_Top : 1
}
Type
Promise.<number>

getColor()

Gets an annotation's color without any specified color space. It is generally recommended to use getColorAsRGB(), getColorAsCMYK() or getColorAsGray() for more predictable behavior
Inherited From:
Returns:
A promise that resolves to a ColorPt object containing an array of numbers in the range 0.0 to 1.0.
Type
Promise.<PDFNet.ColorPt>

getColorAsCMYK()

Returns the annotation's color in CMYK color space.
Inherited From:
Returns:
A promise that resolves to a ColorPt object containing an array of four numbers in the range 0.0 to 1.0, representing a CMYK color used for the following purposes: The background of the annotation's icon when closed The title bar of the annotation's pop-up window The border of a link annotation If the annotation does not specify an explicit color, a default color is returned. Text annotations return 'default yellow;' all others return black.
Type
Promise.<PDFNet.ColorPt>

getColorAsGray()

Returns the annotation's color in Gray color space.
Inherited From:
Returns:
A promise that resolves to a ColorPt object containing a number in the range 0.0 to 1.0, representing a Gray Scale color used for the following purposes: The background of the annotation's icon when closed The title bar of the annotation's pop-up window The border of a link annotation If the annotation does not specify an explicit color, black color is returned.
Type
Promise.<PDFNet.ColorPt>

getColorAsRGB()

Gets an annotation's color in RGB color space.
Inherited From:
Returns:
A promise that resolves to a ColorPt object containing an array of three numbers in the range 0.0 to 1.0, representing an RGB colour used for the following purposes: The background of the annotation's icon when closed The title bar of the annotation's pop-up window The border of a link annotation If the annotation does not specify an explicit color, a default color is returned. Text annotations return 'default yellow;' all others return black.
Type
Promise.<PDFNet.ColorPt>

getColorCompNum()

Returns the color space the annotation's color is represented in.
Inherited From:
Returns:
A promise that resolves to an integer that is either 1(for DeviceGray), 3(DeviceRGB), or 4(DeviceCMYK). If the annotation has no color, i.e. is transparent, 0 will be returned.
Type
Promise.<number>

getContentRect()

Returns the inner bounding rectangle of the Markup annotation.
Inherited From:
Returns:
A promise that resolves to a rectangle specifying the region where content should be displayed. Note: This rectangle can be same as or inside of the annotation's rectangle. If it is smaller, such a difference may occur in situations where a border effect causes the size of the annotation Rect entry to increase beyond that of the rectangle. For FreeText annotation with a callout, content rectangle specifies an inner region for the text to be displayed. Note: According to PDF Reference Manual content rectangle is not the property that is expected for Markup annotations in general, but it applies to many derived annotation classes (FreeText,Square,Circle,Caret) and therefore get()/set() methods are provided in the base class Markup. Annotations that do not use this property will ignore the content rectangle ('RD' entry), if present in their annotation dictionary.
Type
Promise.<PDFNet.Rect>

getContents()

Extract the content of this annotation. (Optional).
Inherited From:
Returns:
A promise that resolves to A unicode string object with the text that is associated with this annotation. This is the text that annotation displays on user interaction, if the annotation type supports it.
Type
Promise.<string>

getCreationDates()

Inherited From:
Returns:
A promise that resolves to the creation date for the markup annotation. Note: This corresponds to the 'CreationDate' field of the markup annotation's dictionary.
Type
Promise.<PDFNet.Date>

getCustomData(key)

Returns custom data associated with the given key.
Parameters:
Name Type Description
key string The key for which to retrieve the associated data.
Inherited From:
Returns:
A promise that resolves to the custom data string. If no data is available an empty string is returned.
Type
Promise.<string>

getDate()

Gets an annotation's last modified date.
Inherited From:
Returns:
A promise that resolves to the annotation's last modified time and date. If the annotation has no associated date structure, the returned date is not valid (date.IsValid() returns false). Corresponds to the "M" entry of the annotation dictionary.
Type
Promise.<PDFNet.Date>

getEndPoint()

Returns the coordinates of the end of a line.
Inherited From:
Returns:
A promise that resolves to a point specifying the coordinates of the end of the line.
Type
Promise.<PDFNet.Point>

getEndStyle()

Overrides:
Returns:
A promise that resolves to an object of type: "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
}
Type
Promise.<number>

getFlag(flag)

Parameters:
Name Type Description
flag number
PDFNet.Annot.Flag = {
	e_invisible : 0
	e_hidden : 1
	e_print : 2
	e_no_zoom : 3
	e_no_rotate : 4
	e_no_view : 5
	e_annot_read_only : 6
	e_locked : 7
	e_toggle_no_view : 8
	e_locked_contents : 9
}
The Flag property to query.
Inherited From:
Returns:
A promise that resolves to the value of given Flag
Type
Promise.<boolean>

getIntentName()

Returns the intent name as a value of the "IntentName" enumeration type.
See:
  • IntentType
Returns:
A promise that resolves to the intent type of the annotation.
Type
Promise.<number>
Example
Return value enum:
<pre>
PDFNet.PolyLineAnnot.IntentType = {
	e_PolygonCloud : 0
	e_PolyLineDimension : 1
	e_PolygonDimension : 2
	e_Unknown : 3
}
</pre>

getIntentType()

Returns the intent type of the line.
Inherited From:
Returns:
A promise that resolves to an intent type value from the "IntentType" enum. Note: Intent type describes the intent of the line annotation. Valid values shall be "e_LineArrow", which means that the annotation is intended to function as an arrow, and "e_LineDimension", which means that the annotation is intended to function as a dimension line.
Type
Promise.<number>
Example
Return value enum:
<pre>
PDFNet.LineAnnot.IntentType = {
	e_LineArrow : 0
	e_LineDimension : 1
	e_null : 2
}
</pre>

getInteriorColor()

Returns the interior color of the annotation.
Inherited From:
Returns:
A promise that resolves to a ColorPt object that denotes the color of the annotation. Note: The color can be in different color spaces: Gray, RGB, or CMYK. Call "GetInteriorColorCompNum" to access the color space information. Note: According to PDF Reference Manual interior color is not the property that is expected for Markup annotations in general, but it applies to many derived annotations (Line,Square,Circle,Polygon,PolyLine,Redaction) and therefore get()/set() methods are provided in the base class Markup. Annotations that do not use interior color will ignore the interior color ('IC' entry), if present in their annotation dictionary. In case no color is specified, CMYK white is returned.
Type
Promise.<PDFNet.ColorPt>

getInteriorColorCompNum()

Returns the number indicating the interior color space of the annotation.
Inherited From:
Returns:
A promise that resolves to an integer indicating the number of channels forming the color space. 3 corresponds to RGB, 4 corresponds to CMYK, and 1 corresponds to Gray. If the interior is transparent, the return value is 0.
Type
Promise.<number>

getLeaderLineExtensionLength()

Returns the leader line extension length of a line.
Inherited From:
Returns:
A promise that resolves to a number denoting the length of the leader line extension in default user space units. Note: The leader line extension length is a non-negative number that shall represents the length of leader line extensions that extend from the line proper 180 degrees from the leader lines. Default value: 0 (no leader line extensions)
Type
Promise.<number>

getLeaderLineLength()

Returns the leader line length of a line.
Inherited From:
Returns:
A promise that resolves to a number denoting the length of the leader line in default user space units. Note: Usually if this entry is specified, the line is intended to be a dimension line (see "IT" entry of the annotation dictionary). Note: Leader length is length of leader lines in default user space that extend from each endpoint of the line perpendicular to the line itself. A positive value shall mean that the leader lines appear in the direction that is clockwise when traversing the line from its starting point to its ending point (as specified by L); a negative value shall indicate the opposite direction. Default value: 0 (no leader lines)
Type
Promise.<number>

getLeaderLineOffset()

Returns the leader line offset length of a line.
Inherited From:
Returns:
A promise that resolves to a number denoting the length of the leader line offset in default user space units. Note: Leader line offset number is a non-negative number that shall represent the length of the leader line offset, which is the amount of empty space between the endpoints of the annotation and the beginning of the leader lines.
Type
Promise.<number>

getOpacity()

Inherited From:
Returns:
A promise that resolves to the opacity value. Default value: 1.0. Note: This value is applied to all visible elements of the annotation in its closed state (including its background and border) but not to the pop-up window that appears when the annotation is opened. When an appearance stream is presented with the annotation, this entry is ignored.(However, if the compliant viewer regenerates the annotation's appearance stream, it may incorporate this Opacity entry into the stream's content.) Note: This corresponds to the 'CA' field of the annotation's dictionary.
Type
Promise.<number>

getOptionalContent()

Returns optional content associated with this annotation.
Inherited From:
Returns:
A promise that resolves to a SDF object corresponding to the group of optional properties. Note: The return value is an Optional Content Group (OCG) or Optional Content Membership Dictionary (PDF::OCG::OCMD) specifying the optional content properties for the annotation. Before the annotation is drawn, its visibility shall be determined based on this entry as well as the annotation flags specified in the Flag entry. If it is determined to be invisible, the annotation shall be skipped, as if it were not in the document.
Type
Promise.<PDFNet.Obj>

getPadding()

Returns the rectangle difference between overall annotation rectangle and content rectangle.
Inherited From:
See:
  • GetContentRect()
Returns:
A promise that resolves to a set of four numbers represented as a Rect struct. Note: The four numbers of the returning struct specify the difference between two rectangles: the Rect entry of the annotation and the actual bounding box of the underlying rectangle. Such a difference may occur in situations where a border effect causes the size of the annotation Rect entry to increase beyond that of the rectangle. The four numbers of the returning struct correspond to the differences in default user space, between the left, top, right, and bottom of the two above mentioned rectangles. Note: GetPadding() and GetContentRectangle() both use 'RD' entry of the annotation dictionary, but represent it to user in different ways.
Type
Promise.<PDFNet.Rect>

getPage()

Gets the page the annotation is associated with.
Inherited From:
Returns:
A promise that resolves to a Page object or null page object if the page reference is not available. The page object returned is an indirect reference to the page object with which this annotation is associated. This entry shall be present in screen annotations associated with rendition actions. Optional. PDF 1.3 PDF 1.4 PDF 1.5 not used in FDF files.
Type
Promise.<PDFNet.Page>

getPopup()

Returns the Popup object associated with this markup annotation.
Inherited From:
Returns:
A promise that resolves to a Popup object that is associated with this markup annotation. Note: The Popup is An indirect reference to a pop-up annotation for entering or editing the text associated with this annotation.
Type
Promise.<PDFNet.Annot>

getRect()

Inherited From:
Returns:
A promise that resolves to annotation's bounding rectangle, specified in user space coordinates. The meaning of the rectangle depends on the annotation type. For Link and RubberStamp annotations, the rectangle specifies the area containing the hyperlink area or stamp. For Note annotations, the rectangle is describing the popup window when it's opened. When it's closed, the icon is positioned at lower left corner.
Type
Promise.<PDFNet.Rect>

getRotation()

Returns the rotation value of the annotation. The Rotation specifies the number of degrees by which the annotation shall be rotated counterclockwise relative to the page. The value shall be a multiple of 90.
Inherited From:
Returns:
A promise that resolves to an integer representing the rotation value of the annotation. Note: This property is part of the appearance characteristics dictionary, this dictionary that shall be used in constructing a dynamic appearance stream specifying the annotation's visual presentation on the page.
Type
Promise.<number>

getSDFObj()

Inherited From:
Returns:
A promise that resolves to the underlying SDF/Cos object.
Type
Promise.<PDFNet.Obj>

getShowCaption()

Returns true if caption is to be shown, otherwise false.
Inherited From:
Returns:
A promise that resolves to a boolean value indicating whether the caption will be shown. Note: If true, the text specified by the Contents or RCentries shall be replicated as a caption in the appearance of the line. The text shall be rendered in a manner appropriate to the content, taking into account factors such as writing direction. Default value: false.
Type
Promise.<boolean>

getStartPoint()

Returns the coordinates of the start of a line.
Inherited From:
Returns:
A promise that resolves to a point specifying the coordinates of the start of the line.
Type
Promise.<PDFNet.Point>

getStartStyle()

Overrides:
Returns:
A promise that resolves to an object of type: "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
}
Type
Promise.<number>

getStructParent()

Returns the struct parent of an annotation. (Required if the annotation is a structural content item; PDF 1.3)
Inherited From:
Returns:
A promise that resolves to an integer which is the integer key of the annotation's entry in the structural parent tree. Note: The StructParent is the integer key of the annotation's entry in the structural parent tree.
Type
Promise.<number>

getSubject()

Returns the subject of the Markup annotation. (PDF 1.5)
Inherited From:
Returns:
A promise that resolves to a string representing the subject of the Markup annotation. Note: The subject is a short piece of text description about the annotation. Note: This corresponds to the 'Subj' field of the annotation's dictionary.
Type
Promise.<string>

getTextHOffset()

Returns the horizontal offset of the caption.
Inherited From:
Returns:
A promise that resolves to a number denoting the horizontal offset of the caption in default user space units. Note: The horizontal offset specifies the offset of the caption text from the line's midpoint, with a positive value indicating offset to the right and a negative value indicating offset to the left. Default value: 0 (no offset from normal horizontal positioning).
Type
Promise.<number>

getTextVOffset()

Returns the vertical offset of the caption.
Inherited From:
Returns:
A promise that resolves to a number denoting the vertical offset of the caption in default user space units. Note: The vertical offset specifies the offset of the caption text perpendicular to the annotation line, with a positive value indicating a shift up and a negative value indicating a shift down. Default value: 0 (no offset from normal vertical positioning).
Type
Promise.<number>

getTitle()

Returns the title of the markup annotation.
Inherited From:
Returns:
A promise that resolves to a string representing the title of the markup annotation, or null is the title is not specified. Note: The title is The text label that is displayed in the title bar of the annotation's pop-up window when open and active Markup annotation. This entry is also used to identify the user who added the annotation. It corresponds to the 'T' field of the annotation's dictionary.
Type
Promise.<string>

getTriggerAction(trigger)

Get the Action associated with the selected Annot Trigger event.
Parameters:
Name Type Description
trigger number
PDFNet.Annot.EventType = {
	e_action_trigger_activate : 0
	e_action_trigger_annot_enter : 1
	e_action_trigger_annot_exit : 2
	e_action_trigger_annot_down : 3
	e_action_trigger_annot_up : 4
	e_action_trigger_annot_focus : 5
	e_action_trigger_annot_blur : 6
	e_action_trigger_annot_page_open : 7
	e_action_trigger_annot_page_close : 8
	e_action_trigger_annot_page_visible : 9
	e_action_trigger_annot_page_invisible : 10
}
the type of trigger event to get
Inherited From:
Returns:
A promise that resolves to the Action Obj if present, otherwise NULL
Type
Promise.<PDFNet.Obj>

getType()

Inherited From:
Returns:
A promise that resolves to the type of this annotation. Corresponds to the "Subtype" entry of annotation dictionary, as per PDF Reference Manual section 12.5.2
Type
Promise.<number>
Example
Return value enum:
<pre>
PDFNet.Annot.Type = {
	e_Text : 0
	e_Link : 1
	e_FreeText : 2
	e_Line : 3
	e_Square : 4
	e_Circle : 5
	e_Polygon : 6
	e_Polyline : 7
	e_Highlight : 8
	e_Underline : 9
	e_Squiggly : 10
	e_StrikeOut : 11
	e_Stamp : 12
	e_Caret : 13
	e_Ink : 14
	e_Popup : 15
	e_FileAttachment : 16
	e_Sound : 17
	e_Movie : 18
	e_Widget : 19
	e_Screen : 20
	e_PrinterMark : 21
	e_TrapNet : 22
	e_Watermark : 23
	e_3D : 24
	e_Redact : 25
	e_Projection : 26
	e_RichMedia : 27
	e_Unknown : 28
}
</pre>

getUniqueID()

Inherited From:
Returns:
A promise that resolves to the unique identifier for this annotation, or NULL if the identifier is not available. The returned value is a String object and is the value of the "NM" field, which was added as an optional attribute in PDF 1.4.
Type
Promise.<PDFNet.Obj>

getVertex(idx)

Returns the vertex(as a Point object) corresponding to the index within the Vertices array.
Parameters:
Name Type Description
idx number The index of the vertex, should be less than the value returned by GetVertexCount().
Returns:
A promise that resolves to a Point object corresponding to the vertex in the specified index position. Note: The Vertices are the points between which the lines are drawn. The viewer can draw either the straight lines or the smoothly connecting ones.
Type
Promise.<PDFNet.Point>

getVertexCount()

Returns the number of vertices in the Vertices array.
Returns:
A promise that resolves to the number of vertices. Note: The Vertices are the points between which the lines are drawn. The viewer can draw either the straight lines or the smoothly connecting ones.
Type
Promise.<number>

getVisibleContentBox()

It is possible during viewing that GetRect does not return the most accurate bounding box of what is actually rendered. This method calculates the bounding box, rather than relying on what is specified in the PDF document. The bounding box is defined as the smallest rectangle that includes all the visible content on the annotation.
Inherited From:
Returns:
A promise that resolves to the bounding box for this annotation. The dimensions are specified in user space coordinates.
Type
Promise.<PDFNet.Rect>

isMarkup()

Return true if this annotation is classified as a markup annotation.
Inherited From:
Returns:
A promise that resolves to boolean value, true if this annotation is classified as a markup annotation.
Type
Promise.<boolean>

isValid()

Inherited From:
Returns:
A promise that resolves to true if this is a valid (non-null) annotation, false otherwise. If the function returns false the underlying SDF/Cos object is null or is not valid and the annotation object should be treated as a null object.
Type
Promise.<boolean>

refreshAppearance()

Regenerates the appearance stream for the annotation. This method can be used to auto-generate the annotation appearance after creating or modifying the annotation without providing an explicit appearance or setting the "NeedAppearances" flag in the AcroForm dictionary. Note: If this annotation contains text, and has been added to a rotated page, the text in the annotation may be rotated. If RefreshAppearance is called *after* the annotation is added to a rotated page, then any text will be rotated in the opposite direction of the page rotation. If this method is called *before* the annotation is added to any rotated page, then no counter rotation will be applied. If you wish to call RefreshAppearance on an annotation already added to a rotated page, but you don't want the text to be rotated, you can do one of the following; temporarily un-rotate the page, or, temporarily remove the "Rotate" object from the annotation. To support users adding text annotations while using a PDF viewer, you can also add any viewer rotation to the annotations Rotate object, to have text always rotated correctly, from the users perspective.
Inherited From:
Returns:
Type
Promise.<void>

refreshAppearanceRefreshOptions( [options])

A version of RefreshAppearance allowing custom options to make slight tweaks in behaviour.
Parameters:
Name Type Argument Description
options PDFNet.PDFDoc.RefreshOptions <optional>
The RefreshOptions.
Inherited From:
Returns:
Type
Promise.<void>

removeAppearance( [annot_state] [, app_state])

Removes the annotation's appearance for the given combination of annotation and appearance states.
Parameters:
Name Type Argument Description
annot_state number <optional>
PDFNet.Annot.State = {
	e_normal : 0
	e_rollover : 1
	e_down : 2
}
the annotation's appearance state, which selects the applicable appearance stream from the appearance sub-dictionary. An annotation can define as many as three separate appearances: The normal, rollover, and down appearance.
app_state string <optional>
is an optional parameter specifying the appearance state (e.g. "Off", "On", etc) under which the new appearance should be stored. If appearance_state is NULL, the annotation will have only one annotation state.
Inherited From:
Returns:
Type
Promise.<void>

resize(newrect)

Scales the geometry of the annotation so that its appearance would now fit a new rectangle on the page, in user units. Users still have to call RefreshAppearance() later if they want a corresponding appearance stream to be generated for the new rectangle. The main reason for not combining the two operations together is to be able to resize annotations that do not have an appearance stream.
Parameters:
Name Type Description
newrect PDFNet.Rect A reference to the new rectangle to which this annotation has to be resized.
Inherited From:
Returns:
Type
Promise.<void>

rotateAppearance(angle)

Rotates the appearance of the Markup annotation.
Parameters:
Name Type Description
angle number The new rotation Note: Apply a rotation to an existing appearance. This rotation will be reflected in the bounding rect of the annot (which will be updated), but not in any other part of the annotation dictionary. This will effectively create a custom appearance for the annotation, and any subsequent calls to `RefreshAppearance` will clear this transformation.
Inherited From:
Returns:
Type
Promise.<void>

setActiveAppearanceState(astate)

Sets the annotation's active appearance state. (Required if the appearance dictionary AP contains one or more subdictionaries; PDF 1.2)
Parameters:
Name Type Description
astate string Character string representing the name of the active appearance state. The string used to select the annotation's appearance state, which selects the applicable appearance stream from an appearance subdictionary.
Inherited From:
Returns:
Type
Promise.<void>

setAppearance(app_stream [, annot_state] [, app_state])

Sets the annotation's appearance for the given combination of annotation and appearance states. (Optional; PDF 1.2)
Parameters:
Name Type Argument Description
app_stream PDFNet.Obj a content stream defining the new appearance.
annot_state number <optional>
PDFNet.Annot.State = {
	e_normal : 0
	e_rollover : 1
	e_down : 2
}
the annotation's appearance state, which selects the applicable appearance stream from the appearance sub-dictionary. An annotation can define as many as three separate appearances: The normal, rollover, and down appearance.
app_state string <optional>
is an optional parameter specifying the appearance state (e.g. "Off", "On", etc) under which the new appearance should be stored. If appearance_state is NULL, the annotation will have only one annotation state.
Inherited From:
Returns:
Type
Promise.<void>

setBorderEffect( [effect])

Sets the border effect of the markup annotation. (Optional; PDF 1.5 ) Beginning with PDF 1.5, some annotations (square, circle, and polygon) may have a 'BE' entry, which is a border effect dictionary that specifies an effect that shall be applied to the border of the annotations. Beginning with PDF 1.6, the free text annotation may also have a BE entry.
Parameters:
Name Type Argument Description
effect number <optional>
PDFNet.MarkupAnnot.BorderEffect = {
	e_None : 0
	e_Cloudy : 1
}
An entry from the enum "BorderEffect" that represents the border effect of the Markup annotation. Default value: e_None. Note: When "e_Cloudy" is chosen,the width and dash array specified by the annotation's BorderStyle entry needs to be taken into consideration.
Inherited From:
Returns:
Type
Promise.<void>

setBorderEffectIntensity( [intensity])

Sets the border effect intensity of the markup annotation. (Optional; valid only if Border effect is Cloudy) Beginning with PDF 1.5, some annotations (square, circle, and polygon) may have a 'BE' entry, which is a border effect dictionary that specifies an effect that shall be applied to the border of the annotations. Beginning with PDF 1.6, the free text annotation may also have a BE entry.
Parameters:
Name Type Argument Description
intensity number <optional>
A number describing the intensity of the border effect, in the range 0 (which is default) to 2. Note: this parameter applies only if Border effect is e_Cloudy.
Inherited From:
Returns:
Type
Promise.<void>

setBorderStyle(bs [, oldStyleOnly])

Sets the border style for the annotation.
Parameters:
Name Type Argument Description
bs PDFNet.AnnotBorderStyle New border style for this annotation.
oldStyleOnly boolean <optional>
PDF manual specifies two ways to add border information to an annotation object, either through an array named 'Border' (PDF 1.0), or a dictionary called 'BS' (PDF 1.2) the latter taking precedence over the former. However, if you want to create a border with rounded corners, you can only do that using PDF 1.0 Border specification, in which case if you call SetBorderStyle() set the parameter oldStyleOnly to true. This parameter has a default value of false in the API and does not need to be used otherwise.
Inherited From:
Returns:
Type
Promise.<void>

setCapPos(it)

Parameters:
Name Type Description
it number
PDFNet.LineAnnot.CapPos = {
	e_Inline : 0
	e_Top : 1
}
Inherited From:
Returns:
Type
Promise.<void>

setColor(col [, numcomp])

Sets an annotation's color. (Optional; PDF 1.1)
Parameters:
Name Type Argument Description
col PDFNet.ColorPt A ColorPt object in RGB or Gray or CMYK color space representing the annotation's color. The ColorPt contains an array of numbers in the range 0.0 to 1.0, representing a color used for the following purposes: The background of the annotation's icon when closed The title bar of the annotation's pop-up window The border of a link annotation The number of array elements determines the color space in which the color shall be defined: 0 No color; transparent 1 DeviceGray 3 DeviceRGB 4 DeviceCMYK
numcomp number <optional>
The number of color components used to represent the color (i.e. 1, 3, 4).
Inherited From:
Returns:
Type
Promise.<void>

setColorDefault(col)

Parameters:
Name Type Description
col PDFNet.ColorPt
Inherited From:
Returns:
Type
Promise.<void>

setContentRect(cr)

Sets the inner bounding rectangle of the Markup annotation. (Optional)
Parameters:
Name Type Description
cr PDFNet.Rect A Rect struct to be assign to the 'RD' entry of the annotation dictionary. Note: This rectangle can be same as or inside of the annotation's rectangle. If it is smaller, such a difference may occur in situations where a border effect causes the size of the annotation Rect entry to increase beyond that of the rectangle. For FreeText annotation with a callout, content rectangle specifies an inner region for the text to be displayed. Note: According to PDF Reference Manual content rectangle is not the property that is expected for Markup annotations in general, but it applies to many derived annotation classes (FreeText,Square,Circle,Caret) and therefore get()/set() methods are provided in the base class Markup. Annotations that do not use this property will ignore the content rectangle ('RD' entry), if present in their annotation dictionary.
Inherited From:
Returns:
Type
Promise.<void>

setContents(contents)

Sets the content of this annotation. (Optional).
Parameters:
Name Type Description
contents string A reference to unicode string object with the text that will be associated with this annotation. This is the text that annotation displays on user interaction, if the annotation type supports it.
Inherited From:
Returns:
Type
Promise.<void>

setCreationDates(dt)

Sets the creation date for the markup annotation. (Optional; PDF 1.5 )
Parameters:
Name Type Description
dt PDFNet.Date A Date object indicating the date the markup annotation is created. Note: This corresponds to the 'CreationDate' field of the markup annotation's dictionary.
Inherited From:
Returns:
Type
Promise.<void>

setCustomData(key, value)

Sets the custom data associated with the specified key.
Parameters:
Name Type Description
key string The key under which to store this custom data
value string The custom data string to store
Inherited From:
Returns:
Type
Promise.<void>

setDate(date)

Sets an annotation's last modified date.
Parameters:
Name Type Description
date PDFNet.Date The annotation's last modified time and date. Corresponds to the "M" entry of the annotation dictionary.
Inherited From:
Returns:
Type
Promise.<void>

setEndPoint(ep)

Sets the coordinates of the end of a line.
Parameters:
Name Type Description
ep PDFNet.Point A point specifying the coordinates of the end of the line.
Inherited From:
Returns:
Type
Promise.<void>

setEndStyle(style)

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
}
Overrides:
Returns:
Type
Promise.<void>

setFlag(flag, value)

Sets the value of given Flag.
Parameters:
Name Type Description
flag number
PDFNet.Annot.Flag = {
	e_invisible : 0
	e_hidden : 1
	e_print : 2
	e_no_zoom : 3
	e_no_rotate : 4
	e_no_view : 5
	e_annot_read_only : 6
	e_locked : 7
	e_toggle_no_view : 8
	e_locked_contents : 9
}
The Flag property to modify.
value boolean The new value for the property.
Inherited From:
Returns:
Type
Promise.<void>

setIntentName(mode)

Sets the Intent name as a value of the "IntentName" enumeration type. (Optional; PDF 1.6 )
Parameters:
Name Type Description
mode number
PDFNet.PolyLineAnnot.IntentType = {
	e_PolygonCloud : 0
	e_PolyLineDimension : 1
	e_PolygonDimension : 2
	e_Unknown : 3
}
The intent name of the annotation.
See:
  • IntentType
Returns:
Type
Promise.<void>

setIntentType(it)

Sets the intent type of the line. (For PDF 1.6)
Parameters:
Name Type Description
it number
PDFNet.LineAnnot.IntentType = {
	e_LineArrow : 0
	e_LineDimension : 1
	e_null : 2
}
An intent type value from the "IntentType" enum. Note: Intent type describes the intent of the line annotation. Valid values shall be "e_LineArrow", which means that the annotation is intended to function as an arrow, and "e_LineDimension", which means that the annotation is intended to function as a dimension line.
Inherited From:
Returns:
Type
Promise.<void>

setInteriorColor(c, CompNum)

Sets the interior color of the Markup annotation.
Parameters:
Name Type Description
c PDFNet.ColorPt A ColorPt object that denotes the color of the Markup annotation.
CompNum number An integer indicating the number of channels forming the color space used. It also defines the length of the array to be allocated for storing the entries of c. Note: It is necessary to make sure the consistency between the type of parameter c and the value of parameter CompNum. RGB ColorPt corresponds to 3, CMYK ColorPt corresponds to 4, Gray ColorPt corresponds to 1, and transparent corresponds to 0. Note: According to PDF Reference Manual interior color is not the property that is expected for Markup annotations in general, but it applies to many derived annotation classes and therefore get()/set() methods are provided in the base class Markup. Annotations that do not use interior color will ignore the interior color ('IC' entry), if present in their annotation dictionary. Entries out of the specified color space array length will be discarded. Missing entries for a specified color space will lead to potential exceptions.
Inherited From:
Returns:
Type
Promise.<void>

setInteriorColorRGB(col)

Parameters:
Name Type Description
col PDFNet.ColorPt
Inherited From:
Returns:
Type
Promise.<void>

setLeaderLineExtensionLength(length)

Sets the leader line extension length of a line. (PDF 1.6)
Parameters:
Name Type Description
length number A number denoting the length of the leader line extension in default user space units. Note: The leader line extension length is a non-negative number that shall represents the length of leader line extensions that extend from the line proper 180 degrees from the leader lines. Default value: 0 (no leader line extensions)
Inherited From:
Returns:
Type
Promise.<void>

setLeaderLineLength(length)

Sets the leader line length of a line. (PDF 1.6)
Parameters:
Name Type Description
length number A number denoting the length of the leader line in default user space units. Note: Usually if this entry is specified, the line is intended to be a dimension line (see "IT" entry of the annotation dictionary). Note: Leader length is length of leader lines in default user space that extend from each endpoint of the line perpendicular to the line itself. A positive value shall mean that the leader lines appear in the direction that is clockwise when traversing the line from its starting point to its ending point (as specified by L); a negative value shall indicate the opposite direction. Default value: 0 (no leader lines)
Inherited From:
Returns:
Type
Promise.<void>

setLeaderLineOffset(length)

Sets the leader line offset length of a line. (PDF 1.7)
Parameters:
Name Type Description
length number A number denoting the length of the leader line offset in default user space units. Note: Leader line offset number is a non-negative number that shall represent the length of the leader line offset, which is the amount of empty space between the endpoints of the annotation and the beginning of the leader lines.
Inherited From:
Returns:
Type
Promise.<void>

setOpacity(op)

Sets the opacity value for the annotation. (Optional; PDF 1.4 )
Parameters:
Name Type Description
op number A number indicating the Markup annotation's opacity value. Default value: 1.0. Note: This value is applied to all visible elements of the annotation in its closed state (including its background and border) but not to the pop-up window that appears when the annotation is opened. When an appearance stream is presented with the annotation, this entry is ignored.(However, if the compliant viewer regenerates the annotation's appearance stream, it may incorporate this Opacity entry into the stream's content.) Note: This corresponds to the 'CA' field of the annotation's dictionary.
Inherited From:
Returns:
Type
Promise.<void>

setOptionalContent(content)

Associates optional content with this annotation. (Optional, PDF1.5).
Parameters:
Name Type Description
content PDFNet.Obj A pointer to an SDF object corresponding to the optional content, a PDF::OCG::Group or membership dictionary specifying the PDF::OCG::Group properties for the annotation. Before the annotation is drawn, its visibility shall be determined based on this entry as well as the annotation flags specified in the Flag entry . If it is determined to be invisible, the annotation shall be skipped, as if it were not in the document.
Inherited From:
Returns:
Type
Promise.<void>

setPadding(rd)

Sets the rectangle difference between overall annotation rectangle and content rectangle. (Optional)
Parameters:
Name Type Description
rd PDFNet.Rect A set of four numbers represented as a Rect struct Note: The four numbers of rd specify the difference between two rectangles: the Rect entry of the annotation and the actual bounding box of the underlying rectangle. Such a difference may occur in situations where a border effect causes the size of the annotation Rect entry to increase beyond that of the rectangle. The four numbers of the rd correspond to the differences in default user space, between the left, top, right, and bottom of the two above mentioned rectangles. Note: SetPadding() and SetContentRectangle() both use 'RD' entry of the annotation dictionary. Two methods are provided to give users additional flexibility and ease of use in setting the values of the 'RD' field.
Inherited From:
See:
  • GetContentRect()
Returns:
Type
Promise.<void>

setPage(page)

Sets the reference to a page the annotation is associated with. (Optional PDF 1.3; not used in FDF files)
Parameters:
Name Type Description
page PDFNet.Page The page object user wants the annotation to be associated with. Note: The parameter should be an indirect reference to the page object with which this annotation is associated. This entry shall be present in screen annotations associated with rendition actions
Inherited From:
Returns:
Type
Promise.<void>

setPopup(ppup)

Sets the Popup object associated with this markup annotation. (Optional; PDF 1.3 )
Parameters:
Name Type Description
ppup PDFNet.Annot A Popup object that is associated with this markup annotation. Note: the Popup is An indirect reference to a pop-up annotation for entering or editing the text associated with this annotation.
Inherited From:
Returns:
Type
Promise.<void>

setRect(pos)

Sets the size and location of an annotation on its page.
Parameters:
Name Type Description
pos PDFNet.Rect Annotation's bounding rectangle, specified in user space coordinates. The meaning of the rectangle depends on the annotation type. For Link and RubberStamp annotations, the rectangle specifies the area containing the hyperlink area or stamp. For Note annotations, the rectangle is describing the popup window when it's opened. When it's closed, the icon is positioned at lower left corner.
Inherited From:
Returns:
Type
Promise.<void>

setRotation(angle)

Sets the rotation value of the annotation. The Rotation specifies the number of degrees by which the annotation shall be rotated counterclockwise relative to the page. The value shall be a multiple of 90. (Optional)
Parameters:
Name Type Description
angle number An integer representing the rotation value of the annotation. Note: This property is part of the appearance characteristics dictionary, this dictionary that shall be used in constructing a dynamic appearance stream specifying the annotation's visual presentation on the page.
Inherited From:
Returns:
Type
Promise.<void>

setShowCaption(showCaption)

Sets the option of whether to show caption.
Parameters:
Name Type Description
showCaption boolean A boolean value indicating whether the caption will be shown. Note: If true, the text specified by the Contents or RC entries shall be replicated as a caption in the appearance of the line. The text shall be rendered in a manner appropriate to the content, taking into account factors such as writing direction. Default value: false.
Inherited From:
Returns:
Type
Promise.<void>

setStartPoint(sp)

Sets the coordinates of the start of a line.
Parameters:
Name Type Description
sp PDFNet.Point A point specifying the coordinates of the end of the line.
Inherited From:
Returns:
Type
Promise.<void>

setStartStyle(style)

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
}
Overrides:
Returns:
Type
Promise.<void>

setStructParent(parkeyval)

Sets the struct parent of an annotation. (Required if the annotation is a structural content item; PDF 1.3)
Parameters:
Name Type Description
parkeyval number An integer which is the integer key of the annotation's entry in the structural parent tree. Note: The StructParent is the integer key of the annotation's entry in the structural parent tree.
Inherited From:
Returns:
Type
Promise.<void>

setSubject(contents)

Sets subject of the Markup annotation. (Optional; PDF 1.5 )
Parameters:
Name Type Description
contents string A string representing the subject of the Markup annotation. Note: The subject is a short piece of text description about the annotation. Note: This corresponds to the 'Subj' field of the annotation's dictionary.
Inherited From:
Returns:
Type
Promise.<void>

setTextHOffset(offset)

Sets the horizontal offset of the caption. (For PDF 1.7 )
Parameters:
Name Type Description
offset number A number denoting the horizontal offset of the caption in default user space units. Note: The horizontal offset specifies the offset of the caption text from the line's midpoint, with a positive value indicating offset to the right and a negative value indicating offset to the left. Default value: 0 (no offset from normal horizontal positioning).
Inherited From:
Returns:
Type
Promise.<void>

setTextVOffset(offset)

Sets the vertical offset of the caption. (For PDF 1.7 )
Parameters:
Name Type Description
offset number A number denoting the vertical offset of the caption in default user space units. Note: The vertical offset specifies the offset of the caption text perpendicular to the annotation line, with a positive value indicating a shift up and a negative value indicating a shift down. Default value: 0 (no offset from normal vertical positioning).
Inherited From:
Returns:
Type
Promise.<void>

setTitle(title)

Sets the title of the markup annotation. (Optional; PDF 1.1)
Parameters:
Name Type Description
title string A string. Note: The title is The text label that is displayed in the title bar of the annotation's pop-up window when open and active Markup annotation. This entry is also used to identify the user who added the annotation. It corresponds to the 'T' field of the annotation's dictionary.
Inherited From:
Returns:
Type
Promise.<void>

setTitleUString(title)

Sets the title of the markup annotation. (Optional; PDF 1.1)
Parameters:
Name Type Description
title string A string. Note: The title is The text label that is displayed in the title bar of the annotation's pop-up window when open and active Markup annotation. This entry is also used to identify the user who added the annotation. It corresponds to the 'T' field of the annotation's dictionary.
Inherited From:
Returns:
Type
Promise.<void>

setUniqueID(id)

Sets the unique identifier for this annotation.
Parameters:
Name Type Description
id ArrayBuffer | Int8Array | Uint8Array | Uint8ClampedArray A buffer containing a unique identifier for this annotation. Note: It is necessary to ensure that the unique ID generated is actually unique.
Inherited From:
Returns:
Type
Promise.<void>

setVertex(idx, pt)

Sets the vertex(in Point object form) corresponding to the index within the Vertices array.
Parameters:
Name Type Description
idx number The index of the vertex.
pt PDFNet.Point A Point object corresponding to the vertex to be added to the array. Note: The Vertices are the points between which the lines are drawn. The viewer can draw either the straight lines or the smoothly connecting ones.
Returns:
Type
Promise.<void>