Class: InkAnnot

PDFNet. InkAnnot


new InkAnnot()

An ink annotation (PDF 1.3) represents a freehand "scribble" composed of one or more disjoint paths. When opened, it shall display a pop-up window containing the text of the associated note.

Extends

  • MarkupAnnot

Methods


<static> create(doc, pos)

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

<static> createFromAnnot(ann)

creates an Ink annotation and initializes it using given annotation object.
Parameters:
Name Type Description
ann PDFNet.Annot Annot object used to initialize the Ink annotation.
Returns:
A promise that resolves to an object of type: "PDFNet.InkAnnot"
Type
Promise.<PDFNet.InkAnnot>

<static> createFromObj( [d])

creates an Ink 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.InkAnnot"
Type
Promise.<PDFNet.InkAnnot>

erase(pt1, pt2, width)

Erase a rectangle area formed by pt1pt2 with width
Parameters:
Name Type Description
pt1 PDFNet.Point A point object that is one end of the eraser segment
pt2 PDFNet.Point A point object that is the other end of the eraser segment
width number The half width of the eraser
Returns:
A promise that resolves to whether an ink stroke was erased
Type
Promise.<boolean>

getHighlightIntent()

Retrieves whether the Ink will draw like a highlighter.
Returns:
A promise that resolves to true if the Ink will draw like a highlighter. (multiply blend mode) If false it will draw in normal mode. (normal blend mode)
Type
Promise.<boolean>

getPathCount()

Returns number of paths in the annotation.
Returns:
A promise that resolves to an integer representing the number of paths in the 'InkList' entry of the annotation dictionary.
Type
Promise.<number>

getPoint(pathindex, pointindex)

Returns the specific point in a given path.
Parameters:
Name Type Description
pathindex number path index for each the point is returned. Index starts at 0.
pointindex number index of point in the path. Index starts at 0.
Returns:
A promise that resolves to a Point object for specified path and point index.
Type
Promise.<PDFNet.Point>

getPointCount(pathindex)

Returns number of points in a certain stroked path in the InkList.
Parameters:
Name Type Description
pathindex number path index for each the point count is returned. Index starts at 0.
See:
  • GetPathCount()
Returns:
A promise that resolves to an integer representing the number of points in the stroked path of the Ink list.
Type
Promise.<number>

setHighlightIntent(highlight)

Enables or disables the Ink drawing like a highlighter.
Parameters:
Name Type Description
highlight boolean true if the Ink will draw like a highlighter. (multiply blend mode) If false it will draw in normal mode. (normal blend mode)
Returns:
Type
Promise.<void>

setPoint(pathindex, pointindex, pt)

sets the specific point in the Ink List, adding it if needed.
Parameters:
Name Type Description
pathindex number An unsigned integer indicating the index of the path.
pointindex number An unsigned integer indicating the index of the point within the stroked path indicated by the parameter "pathindex".
pt PDFNet.Point A Point object that is to be assigned.
Returns:
Type
Promise.<void>