Class Ink
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.
Implements
Inherited Members
Namespace: pdftron.PDF.Annots
Assembly: PDFTronDotNet.dll
Syntax
public class Ink : Markup, IDisposable
Constructors
Ink(Annot)
Creates an Ink annotation and initialize it using given annotation object.
Declaration
public Ink(Annot ann)
Parameters
Type | Name | Description |
---|---|---|
Annot | ann | the annot |
Remarks
The constructor does not copy any data, but is instead the logical equivalent of a type cast.
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
Ink(Obj)
Creates an Ink annotation and initialize it using given Cos/SDF object.
Declaration
public Ink(Obj d)
Parameters
Type | Name | Description |
---|---|---|
Obj | d | the d |
Remarks
The constructor does not copy any data, but is instead the logical equivalent of a type cast.
Methods
Create(SDFDoc, Rect)
Creates a new Ink annotation, in the specified document.
Declaration
public static Ink Create(SDFDoc doc, Rect pos)
Parameters
Type | Name | Description |
---|---|---|
SDFDoc | doc | A document to which the Ink annotation is added. |
Rect | pos | A rectangle specifying the Ink annotation's bounds, specified in user space coordinates. |
Returns
Type | Description |
---|---|
Ink | A newly created blank Ink annotation. |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
Erase(Point, Point, double)
Erase a rectangle area formed by pt1pt2 with width
Declaration
public bool Erase(Point pt1, Point pt2, double eraserHalfWidth)
Parameters
Type | Name | Description |
---|---|---|
Point | pt1 | A point object that is one end of the eraser segment. |
Point | pt2 | A point object that is the other end of the eraser segment. |
double | eraserHalfWidth | The half width of the eraser. |
Returns
Type | Description |
---|---|
bool | Whether an ink stroke was erased. |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
~Ink()
Releases all resources used by the Ink
Declaration
protected ~Ink()
GetHighlightIntent()
Retrieves whether the Ink will draw like a highlighter.
Declaration
public bool GetHighlightIntent()
Returns
Type | Description |
---|---|
bool | true if the Ink will draw like a highlighter. (multiply blend mode) If false it will draw in normal mode. (normal blend mode) |
GetPathCount()
Gets number of stroked pathes in the InkList.
Declaration
public int GetPathCount()
Returns
Type | Description |
---|---|
int | An integer representing the number of pathes in the Ink list. |
Remarks
The Ink list is An array of n arrays, each representing a stroked path. Each array shall be a series of Point objects specifying points along the path. When drawn, the points shall be connected by straight lines or curves in an implementation-dependent way.
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
GetPoint(int, int)
Gets the specific point in the Ink List.
Declaration
public Point GetPoint(int pathindex, int pointindex)
Parameters
Type | Name | Description |
---|---|---|
int | pathindex | An unsigned integer indicating the index of the stroked path |
int | pointindex | An unsigned integer indicating the index of the point within the stroked path indicated by the parameter "pathindex". |
Returns
Type | Description |
---|---|
Point | A Point object that is located by "pathindex" and "pointindex". |
Remarks
The Ink list is An array of n arrays, each representing a stroked path. Each array shall be a series of Point objects specifying points along the path. When drawn, the points shall be connected by straight lines or curves in an implementation-dependent way.
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
GetPointCount(int)
Gets number of points in a certain stroked path in the InkList.
Declaration
public int GetPointCount(int pathindex)
Parameters
Type | Name | Description |
---|---|---|
int | pathindex | An unsigned integer indicating the index of the stroked path, the number of points within whom is of our interest. |
Returns
Type | Description |
---|---|
int | An integer representing the number of points in the stroked path of the Ink list. |
Remarks
The Ink list is An array of n arrays, each representing a stroked path. Each array shall be a series of Point objects specifying points along the path. When drawn, the points shall be connected by straight lines or curves in an implementation-dependent way.
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
SetHighlightIntent(bool)
Enables or disables the Ink drawing like a highlighter.
Declaration
public void SetHighlightIntent(bool highlight)
Parameters
Type | Name | Description |
---|---|---|
bool | highlight | true if the Ink will draw like a highlighter. (multiply blend mode) If false it will draw in normal mode. (normal blend mode) |
SetPoint(int, int, Point)
Sets the specific point in the Ink List.
Declaration
public void SetPoint(int pathindex, int pointindex, Point pt)
Parameters
Type | Name | Description |
---|---|---|
int | pathindex | An unsigned integer indicating the index of the stroked path |
int | pointindex | An unsigned integer indicating the index of the point within the stroked path indicated by the parameter "pathindex". |
Point | pt | A Point object that is to be located by "pathindex" and "pointindex". |
Remarks
The Ink list is An array of n arrays, each representing a stroked path. Each array shall be a series of Point objects specifying points along the path. When drawn, the points shall be connected by straight lines or curves in an implementation-dependent way.
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |