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

  • LineAnnot

Members


<static> IntentType

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

getEndStyle()

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>

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>

getStartStyle()

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>

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.
Type
Promise.<PDFNet.Point>

getVertexCount()

Returns the number of vertices in the Vertices array.
Returns:
A promise that resolves to the number of vertices.
Type
Promise.<number>

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
}
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>

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