Show / Hide Table of Contents

# 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.

##### Inheritance

object
Annot
Markup
Ink

##### Implements

IDisposable

##### Inherited Members

Markup.GetTitle()
Markup.SetTitle(string)
Markup.GetPopup()
Markup.SetPopup(Popup)
Markup.GetOpacity()
Markup.SetOpacity(double)
Markup.GetSubject()
Markup.SetSubject(string)
Markup.GetCreationDates()
Markup.SetCreationDates(Date)
Markup.GetBorderEffect()
Markup.SetBorderEffect(Markup.BorderEffect)
Markup.GetBorderEffectIntensity()
Markup.SetBorderEffectIntensity(double)
Markup.GetInteriorColor()
Markup.GetInteriorColorCompNum()
Markup.SetInteriorColor(ColorPt, int)
Markup.GetContentRect()
Markup.SetContentRect(Rect)
Markup.GetPadding()
Markup.SetPadding(Rect)
Markup.RotateAppearance(double)
Annot.GetTriggerAction(Annot.EventType)
Annot.Create(SDFDoc, Annot.Type, Rect)
Annot.op_Assign(Annot)
Annot.Equals(object)
Annot.IsValid()
Annot.GetSDFObj()
Annot.GetType()
Annot.IsMarkup()
Annot.GetRect()
Annot.GetVisibleContentBox()
Annot.SetRect(Rect)
Annot.GetContents()
Annot.SetContents(string)
Annot.GetPage()
Annot.SetPage(Page)
Annot.GetUniqueID()
Annot.SetUniqueID(string)
Annot.GetDate()
Annot.SetDate(Date)
Annot.GetFlag(Annot.Flag)
Annot.SetFlag(Annot.Flag, bool)
Annot.GetBorderStyle()
Annot.SetBorderStyle(Annot.BorderStyle)
Annot.GetAppearance(Annot.AnnotationState, string)
Annot.GetAppearance(Annot.AnnotationState)
Annot.GetAppearance()
Annot.SetAppearance(Obj, Annot.AnnotationState, string)
Annot.SetAppearance(Obj, Annot.AnnotationState)
Annot.SetAppearance(Obj)
Annot.RemoveAppearance(Annot.AnnotationState, string)
Annot.RemoveAppearance(Annot.AnnotationState)
Annot.RemoveAppearance()
Annot.Flatten(Page)
Annot.GetActiveAppearanceState()
Annot.SetActiveAppearanceState(string)
Annot.GetColorAsRGB()
Annot.GetColorAsCMYK()
Annot.GetColorAsGray()
Annot.GetColorCompNum()
Annot.SetColor(ColorPt)
Annot.SetColor(ColorPt, int)
Annot.GetStructParent()
Annot.SetStructParent(int)
Annot.GetOptionalContent()
Annot.SetOptionalContent(Obj)
Annot.Resize(Rect)
Annot.GetRotation()
Annot.SetRotation(int)
Annot.RefreshAppearance(RefreshOptions)
Annot.RefreshAppearance()
Annot.GetCustomData(string)
Annot.SetCustomData(string, string)
Annot.DeleteCustomData(string)
Annot.Dispose()
object.ToString()
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.MemberwiseClone()

###### 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

Markup.Dispose(bool)

#### 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).

### Implements

IDisposable