new LineAnnot()
A line annotation (PDF 1.3) is used to display a single straight
line on the page. When opened, it should display a pop-up window containing
the text of the associated note.
Extends
- MarkupAnnot
Members
-
<static> CapPos
-
Properties:
Name Type Description e_Inline
number e_Top
number -
<static> EndingStyle
-
Properties:
Name Type Description e_Square
number e_Circle
number e_Diamond
number e_OpenArrow
number e_ClosedArrow
number e_Butt
number e_ROpenArrow
number e_RClosedArrow
number e_Slash
number e_None
number e_Unknown
number -
<static> IntentType
-
Properties:
Name Type Description e_LineArrow
number e_LineDimension
number e_null
number
Methods
-
<static> create(doc, pos)
-
Creates a new Line annotation in the specified document.
Parameters:
Name Type Description doc
PDFNet.PDFDoc | PDFNet.SDFDoc | PDFNet.FDFDoc A document to which the annotation is added. pos
PDFNet.Rect A rectangle specifying the annotation's bounds in default user space units. Returns:
A promise that resolves to a newly created blank Line annotation.- Type
- Promise.<PDFNet.LineAnnot>
-
<static> createFromAnnot(ann)
-
creates a Line annotation and initializes it using given annotation object.
Parameters:
Name Type Description ann
PDFNet.Annot Annot object used to initialize the Line annotation. Returns:
A promise that resolves to an object of type: "PDFNet.LineAnnot"- Type
- Promise.<PDFNet.LineAnnot>
-
<static> createFromObj( [d])
-
Parameters:
Name Type Argument Description d
PDFNet.Obj <optional>
Returns:
A promise that resolves to an object of type: "PDFNet.LineAnnot"- Type
- Promise.<PDFNet.LineAnnot>
-
getCapPos()
-
Returns:
A promise that resolves to an object of type: "number"PDFNet.LineAnnot.CapPos = { e_Inline : 0 e_Top : 1 }
- Type
- Promise.<number>
-
getEndPoint()
-
Returns the coordinates of the end of a line.
Returns:
A promise that resolves to a point specifying the coordinates of the end of the line.- Type
- Promise.<PDFNet.Point>
-
getEndStyle()
-
Returns the ending style that applies to the second point of the line.
Returns:
A promise that resolves to a enum value from the "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>
-
getIntentType()
-
Returns the intent type of the line.
Returns:
A promise that resolves to an intent type value from the "IntentType" enum.- Type
- Promise.<number>
Example
Return value enum: <pre> PDFNet.LineAnnot.IntentType = { e_LineArrow : 0 e_LineDimension : 1 e_null : 2 } </pre>
-
getLeaderLineExtensionLength()
-
Returns the leader line extension length of a line.
Returns:
A promise that resolves to a number denoting the length of the leader line extension in default user space units.- Type
- Promise.<number>
-
getLeaderLineLength()
-
Returns the leader line length of a line.
Returns:
A promise that resolves to a number denoting the length of the leader line in default user space units.- Type
- Promise.<number>
-
getLeaderLineOffset()
-
Returns the leader line offset length of a line.
Returns:
A promise that resolves to a number denoting the length of the leader line offset in default user space units.- Type
- Promise.<number>
-
getShowCaption()
-
Returns true if caption is to be shown, otherwise false.
Returns:
A promise that resolves to a boolean value indicating whether the caption will be shown.- Type
- Promise.<boolean>
-
getStartPoint()
-
Returns the coordinates of the start of a line.
Returns:
A promise that resolves to a point specifying the coordinates of the start of the line.- Type
- Promise.<PDFNet.Point>
-
getStartStyle()
-
Returns the ending style that applies to the first point of the line.
Returns:
A promise that resolves to a enum value from the "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>
-
getTextHOffset()
-
Returns the horizontal offset of the caption.
Returns:
A promise that resolves to a number denoting the horizontal offset of the caption in default user space units.- Type
- Promise.<number>
-
getTextVOffset()
-
Returns the vertical offset of the caption.
Returns:
A promise that resolves to a number denoting the vertical offset of the caption in default user space units.- Type
- Promise.<number>
-
setCapPos(it)
-
Parameters:
Name Type Description it
number PDFNet.LineAnnot.CapPos = { e_Inline : 0 e_Top : 1 }
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. Returns:
- Type
- Promise.<void>
-
setEndStyle(es)
-
sets the ending style that applies to the second point of the line. (Optional; PDF 1.4)
Parameters:
Name Type Description es
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 }
A enum value from the "EndingStyle".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.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. 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. 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. 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. 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. Returns:
- Type
- Promise.<void>
-
setStartStyle(ss)
-
sets the ending style that applies to the first point of the line. (Optional; PDF 1.4.)
Parameters:
Name Type Description ss
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 }
A enum value from the "EndingStyle".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. 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. Returns:
- Type
- Promise.<void>