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.
Methods
-
<static> create(doc, pos)
-
Creates a new PolyLine annotation in the specified document.
Parameters:
Name Type Description doc
SDFDoc A document to which the PolyLine annotation is added.
pos
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
- PolyLineAnnot
-
<static> createFromAnnot(ann)
-
creates a PolyLine annotation and initializes it using given annotation object.
Parameters:
Name Type Description ann
Annot Annot object used to initialize the PolyLine annotation.
Returns:
A promise that resolves to an object of type: "PolyLineAnnot"
- Type
- PolyLineAnnot
-
<static> createFromObj(d)
-
creates a PolyLine annotation and initializes it using given Cos/SDF object.
Parameters:
Name Type Description d
Obj The Cos/SDF object to initialze the annotation with.
Returns:
A promise that resolves to an object of type: "PolyLineAnnot"
- Type
- PolyLineAnnot
-
getEndStyle()
-
Returns:
A promise that resolves to an unknown type
-
getIntentName()
-
Returns the intent name as a value of the "IntentName" enumeration type.
- See:
-
- IntentType
Returns:
A promise that resolves tos The intent type of the annotation.
- Type
- 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 unknown type
-
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
- point
-
getVertexCount()
-
Returns the number of vertices in the Vertices array.
Returns:
A promise that resolves to the number of vertices.
- Type
- number
-
setEndStyle(style)
-
Parameters:
Name Type Description style
number/enum 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 }
-
setIntentName(mode)
-
Sets the Intent name as a value of the "IntentName" enumeration type. (Optional; PDF 1.6 )
Parameters:
Name Type Description mode
number The intent name of the annotation.
- See:
-
- IntentType
-
setStartStyle(style)
-
Parameters:
Name Type Description style
number/enum 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 }
-
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
point A Point object corresponding to the vertex to be added to the array.