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: PDFNet.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 |
Dispose(bool)
Declaration
[HandleProcessCorruptedStateExceptions]
protected override void Dispose(bool A_0)
Parameters
Type | Name | Description |
---|---|---|
bool | A_0 |
Overrides
Erase(Point, Point, double)
Erase a rectangle area formed by drawing a line from pt1 to pt2 with width
Declaration
public bool Erase(Point pt1, Point pt2, double eraserRadius)
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 | eraserRadius | The radius of the eraser |
Returns
Type | Description |
---|---|
bool | Whether an ink stroke was erased |
~Ink()
Declaration
protected ~Ink()
GetBlendMode()
Gets the blend mode used for drawing the ink.
Declaration
public GState.BlendMode GetBlendMode()
Returns
Type | Description |
---|---|
GState.BlendMode |
Remarks
This method is deprecated and will be removed in a future version of PDFNet. It is strongly recommended to use GetHighlightIntent() instead.
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 |
GetSmoothing()
Gets whether smoothing should be used then refreshing the inks appearance
Declaration
public bool GetSmoothing()
Returns
Type | Description |
---|---|
bool |
SetBlendMode(BlendMode)
Sets the blend mode use for drawing the ink.
Declaration
public void SetBlendMode(GState.BlendMode blend_mode)
Parameters
Type | Name | Description |
---|---|---|
GState.BlendMode | blend_mode | The blend mode (default is e_bl_normal) |
Remarks
This method is deprecated and will be removed in a future version of PDFNet. It is strongly recommended to use SetHighlightIntent(bool) instead.
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 |
SetSmoothing(bool)
Sets whether smoothing should be used then refreshing the inks appearance
Declaration
public void SetSmoothing(bool useSmoothing)
Parameters
Type | Name | Description |
---|---|---|
bool | useSmoothing | A bool indicating whether smoothing should be used (true by default). |