Show / Hide Table of Contents

# Class Annot

Adds an annotation at the specified location in a page's annotation array.

##### Inheritance

object
Annot
Link
Markup
Movie
Popup
Screen
Watermark
Widget

##### Implements

IDisposable

##### Inherited Members

object.ToString()
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.MemberwiseClone()

###### Namespace: pdftron.PDF

###### Assembly: PDFNet.dll

##### Syntax

    public class Annot : IDisposable

##### Remarks

Removing the annotation invalidates the given Annot object.

### Constructors

#### Annot(Annot)

create and initialize `Annot` object from a given one

##### Declaration

    public Annot(Annot b)

##### Parameters

Type | Name | Description
--- | --- | ---
Annot | b | another `Annot` object

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception
PDFNetException | PDFNetException the PDFNet exception
PDFNetException | PDFNetException the PDFNet exception
PDFNetException | PDFNetException the PDFNet exception
PDFNetException | PDFNetException the PDFNet exception

#### Annot(Obj)

Create an annotation and initialize it using given Cos/SDF object.

##### Declaration

    public Annot(Obj b)

##### Parameters

Type | Name | Description
--- | --- | ---
Obj | b | a `SDF::Obj` object

##### 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
PDFNetException | PDFNetException the PDFNet exception
PDFNetException | PDFNetException the PDFNet exception
PDFNetException | PDFNetException the PDFNet exception
PDFNetException | PDFNetException the PDFNet exception

### Methods

#### Create(SDFDoc, Type, Rect)

Creates a new annotation of a given type, in the specified document. Because the newly created annotation does not contain any properties specific to a given annotation type, it is faster to create an annotation using type specific Annot.Create method.

##### Declaration

    public static Annot Create(SDFDoc doc, Annot.Type type, Rect pos)

##### Parameters

Type | Name | Description
--- | --- | ---
SDFDoc | doc | A document to which the annotation is added.
Annot.Type | type | Subtype of annotation to create.
Rect | pos | A rectangle specifying the annotation's bounds, specified in user space coordinates.

##### Returns

Type | Description
--- | ---
Annot | A newly created blank annotation for the given annotation type.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### DeleteCustomData(string)

Deletes custom data associated with the given key.

##### Declaration

    public void DeleteCustomData(string key)

##### Parameters

Type | Name | Description
--- | --- | ---
string | key | The key for which to delete the associated data.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### Dispose()

Releases all resources used by the Annot

##### Declaration

    public override sealed void Dispose()

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception
PDFNetException | PDFNetException the PDFNet exception
PDFNetException | PDFNetException the PDFNet exception
PDFNetException | PDFNetException the PDFNet exception
PDFNetException | PDFNetException the PDFNet exception

#### Dispose(bool)

##### Declaration

    [HandleProcessCorruptedStateExceptions]
    protected virtual void Dispose(bool A_0)

##### Parameters

Type | Name | Description
--- | --- | ---
bool | A_0 |

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception
PDFNetException | PDFNetException the PDFNet exception
PDFNetException | PDFNetException the PDFNet exception
PDFNetException | PDFNetException the PDFNet exception
PDFNetException | PDFNetException the PDFNet exception

#### Equals(object)

##### Declaration

    public override bool Equals(object o)

##### Parameters

Type | Name | Description
--- | --- | ---
object | o | a given `Object`

##### Returns

Type | Description
--- | ---
bool | true, if equals to the given object

##### Overrides

object.Equals(object)

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception
PDFNetException | PDFNetException the PDFNet exception
PDFNetException | PDFNetException the PDFNet exception
PDFNetException | PDFNetException the PDFNet exception
PDFNetException | PDFNetException the PDFNet exception

#### ~Annot()

##### Declaration

    protected ~Annot()

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception
PDFNetException | PDFNetException the PDFNet exception
PDFNetException | PDFNetException the PDFNet exception
PDFNetException | PDFNetException the PDFNet exception
PDFNetException | PDFNetException the PDFNet exception

#### Flatten(Page)

Flatten/Merge the existing annotation appearances with the page content and delete this annotation from a given page.

Annotation 'flattening' refers to the operation that changes active annotations (such as markup, widgets, 3D models, etc.) into a static area that is part of the PDF document, just like the other text and images in the document.

##### Declaration

    public void Flatten(Page page)

##### Parameters

Type | Name | Description
--- | --- | ---
Page | page | the page

##### Remarks

an alternative approach to set the annotation as read only is using

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### GetActiveAppearanceState()

Gets the annotation's active appearance state.

##### Declaration

    public string GetActiveAppearanceState()

##### Returns

Type | Description
--- | ---
string | the name of the active state. The annotation's appearance state, which selects the applicable appearance stream from an appearance subdictionary.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### GetAppearance()

Gets the annotation's appearance for the given combination of annotation and appearance states.

##### Declaration

    public Obj GetAppearance()

##### Returns

Type | Description
--- | ---
Obj | The appearance stream for this annotation, or NULL if the annotation does not have an appearance for the given combination of annotation and appearance states.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### GetAppearance(AnnotationState)

Gets the annotation's appearance for the given combination of annotation and appearance states.

##### Declaration

    public Obj GetAppearance(Annot.AnnotationState annot_state)

##### Parameters

Type | Name | Description
--- | --- | ---
Annot.AnnotationState | annot_state | The annotation's appearance state, which selects the applicable appearance stream from the appearance sub-dictionary. An annotation can define as many as three separate appearances: The normal, rollover, and down appearance.

##### Returns

Type | Description
--- | ---
Obj | the appearance

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### GetAppearance(AnnotationState, string)

Gets the annotation's appearance for the given combination of annotation and appearance states.

##### Declaration

    public Obj GetAppearance(Annot.AnnotationState annot_state, string app_state)

##### Parameters

Type | Name | Description
--- | --- | ---
Annot.AnnotationState | annot_state | The annotation's appearance state, which selects the applicable appearance stream from the appearance sub-dictionary. An annotation can define as many as three separate appearances: The normal, rollover, and down appearance.
string | app_state | Is an optional parameter specifying the appearance state to look for (e.g. "Off", "On", etc). If appearance_state is NULL, the choice between different appearance states is determined by the AS (Appearance State) entry in the annotation dictionary.

##### Returns

Type | Description
--- | ---
Obj | The appearance stream for this annotation, or NULL if the annotation does not have an appearance for the given combination of annotation and appearance states.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### GetBorderStyle()

Gets the border style for the annotation. Typically used for Link annotations.

##### Declaration

    public Annot.BorderStyle GetBorderStyle()

##### Returns

Type | Description
--- | ---
Annot.BorderStyle | Annotation's border style.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### GetColorAsCMYK()

Gets an annotation's color.

##### Declaration

    public ColorPt GetColorAsCMYK()

##### Returns

Type | Description
--- | ---
ColorPt | A ColorPt object containing an array of four numbers in the range 0.0 to 1.0, representing a CMYK colour used for the following purposes: The background of the annotation's icon when closed The title bar of the annotation's pop-up window The border of a link annotation If the annotation does not specify an explicit color, a default color is returned. Text annotations return 'default yellow;' all others return black.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### GetColorAsGray()

Gets an annotation's color.

##### Declaration

    public ColorPt GetColorAsGray()

##### Returns

Type | Description
--- | ---
ColorPt | A ColorPt object containing a number in the range 0.0 to 1.0, representing a Gray Scale colour used for the following purposes: The background of the annotation's icon when closed The title bar of the annotation's pop-up window The border of a link annotation If the annotation does not specify an explicit color, a default color is returned. Text annotations return 'default yellow;' all others return black.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### GetColorAsRGB()

Gets an annotation's color.

##### Declaration

    public ColorPt GetColorAsRGB()

##### Returns

Type | Description
--- | ---
ColorPt | A ColorPt object containing an array of three numbers in the range 0.0 to 1.0, representing an RGB colour used for the following purposes: The background of the annotation's icon when closed The title bar of the annotation's pop-up window The border of a link annotation If the annotation does not specify an explicit color, a default color is returned. Text annotations return 'default yellow;' all others return black.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### GetColorCompNum()

Gets the color space the annotation's color is represented in.

##### Declaration

    public int GetColorCompNum()

##### Returns

Type | Description
--- | ---
int | An integer that is either 1(for DeviceGray), 3(DeviceRGB), or 4(DeviceCMYK). If the annotation has no color, i.e. is transparent, 0 will be returned.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### GetContents()

Gets the contents.

##### Declaration

    public string GetContents()

##### Returns

Type | Description
--- | ---
string | the contents

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### GetCustomData(string)

Returns custom data associated with the given key.

##### Declaration

    public string GetCustomData(string key)

##### Parameters

Type | Name | Description
--- | --- | ---
string | key | The key for which to retrieve the associated data.

##### Returns

Type | Description
--- | ---
string | the custom data string. If no data is available an empty string is returned.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### GetDate()

Gets an annotation's last modified date.

##### Declaration

    public Date GetDate()

##### Returns

Type | Description
--- | ---
Date | The annotation's time and date. If the annotation has no associated date structure, the returned date is not valid (date.IsValid() returns false). Corresponds to the "M" entry of the annotation dictionary.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### GetFlag(Flag)

Gets the flag.

##### Declaration

    public bool GetFlag(Annot.Flag flag)

##### Parameters

Type | Name | Description
--- | --- | ---
Annot.Flag | flag | The Flag property to query.

##### Returns

Type | Description
--- | ---
bool | The value of given Flag

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### GetOptionalContent()

Gets optional content of an annotation.

##### Declaration

    public Obj GetOptionalContent()

##### Returns

Type | Description
--- | ---
Obj | An SDF object corresponding to the grup of optional properties.

##### Remarks

The return value is an (optional content) group or (optional content) membership dictionary (PDF::OCG::OCMD)specifying the optional content properties for the annotation. Before the annotation is drawn, its visibility shall be determined based on this entry as well as the annotation flags specified in the Flag entry . If it is determined to be invisible, the annotation shall be skipped, as if it were not in the document.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### GetPage()

Gets the page the annotation is associated with.

##### Declaration

    public Page GetPage()

##### Returns

Type | Description
--- | ---
Page | A Page object or NULL if the page reference is not available. The page object returned is an indirect reference to the page object with which this annotation is associated. This entry shall be present in screen annotations associated with rendition actions. Optional. PDF 1.3 PDF 1.4 PDF 1.5 not used in FDF files.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### GetRect()

Gets the rect.

##### Declaration

    public Rect GetRect()

##### Returns

Type | Description
--- | ---
Rect | Annotation's bounding rectangle, specified in user space coordinates. The meaning of the rectangle depends on the annotation type. For Link and RubberStamp annotations, the rectangle specifies the area containing the hyperlink area or stamp. For Note annotations, the rectangle is describing the popup window when it's opened. When it's closed, the icon is positioned at lower left corner.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### GetRotation()

Gets the rotation value of the Annotation. The Rotation specifies the number of degrees by which the annotation shall be rotated counterclockwise relative to the page. The value shall be a multiple of 90.

##### Declaration

    public int GetRotation()

##### Returns

Type | Description
--- | ---
int | An integer representing the rotation value of the annotation.

##### Remarks

This property is part of the appearance characteristics dictionary, this dictionary shall be used in constructing a dynamic appearance stream specifying the annotation's visual presentation on the page.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### GetSDFObj()

Gets the SDFObj.

##### Declaration

    public Obj GetSDFObj()

##### Returns

Type | Description
--- | ---
Obj | The underlying SDF/Cos object.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### GetStructParent()

Gets the struct parent of an annotation. (Required if the annotation is a structural content item; PDF'1.3)

##### Declaration

    public int GetStructParent()

##### Returns

Type | Description
--- | ---
int | An integer which is the integer key of the annotation's entry in the structural parent tree.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### GetTriggerAction(EventType)

Get the Action associated with the selected Annot Trigger event

##### Declaration

    public Obj GetTriggerAction(Annot.EventType trigger)

##### Parameters

Type | Name | Description
--- | --- | ---
Annot.EventType | trigger | the type of trigger event to get

##### Returns

Type | Description
--- | ---
Obj | The action Obj if present, otherwise NULL

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception
PDFNetException | PDFNetException the PDFNet exception
PDFNetException | PDFNetException the PDFNet exception
PDFNetException | PDFNetException the PDFNet exception
PDFNetException | PDFNetException the PDFNet exception

#### GetType()

Gets the type.

##### Declaration

    public Annot.Type GetType()

##### Returns

Type | Description
--- | ---
Annot.Type | The type of this annotation.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### GetUniqueID()

Gets the unique ID.

##### Declaration

    public Obj GetUniqueID()

##### Returns

Type | Description
--- | ---
Obj | The unique identifier for this annotation, or NULL if the identifier is not available. The returned value is a String object and is the value of the "NM" field, which was added as an optional attribute in PDF 1.4.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### GetVisibleContentBox()

It is possible during viewing that GetRect does not return the most accurate bounding box of what is actually rendered. This method calculates the bounding box, rather than relying on what is specified in the PDF document. The bounding box is defined as the smallest rectangle that includes all the visible content on the annotation.

##### Declaration

    public Rect GetVisibleContentBox()

##### Returns

Type | Description
--- | ---
Rect | the bounding box for this annotation. The dimensions are specified in user space coordinates.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### IsMarkup()

Checks if is markup.

##### Declaration

    public bool IsMarkup()

##### Returns

Type | Description
--- | ---
bool | true, if is markup

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### IsValid()

Checks if is valid.

##### Declaration

    public bool IsValid()

##### Returns

Type | Description
--- | ---
bool | True if this is a valid (non-null) annotation, false otherwise. If the function returns false the underlying SDF/Cos object is null or is not valid and the annotation object should be treated as a null object.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### RefreshAppearance()

Regenerates the appearance stream for the annotation. This method can be used to auto-generate the annotation appearance after creating or modifying the annotation without providing an explicit appearance or setting the "NeedAppearances" flag in the AcroForm dictionary.

##### Declaration

    public void RefreshAppearance()

##### Remarks

If this annotation contains text, and has been added to a rotated page, the text in the annotation may be rotated. If RefreshAppearance is called after the annotation is added to a rotated page, then any text will be rotated in the opposite direction of the page rotation. If this method is called before the annotation is added to any rotated page, then no counter rotation will be applied. If you wish to call RefreshAppearance on an annotation already added to a rotated page, but you don't want the text to be rotated, you can do one of the following; temporarily un-rotate the page, or, temporarily remove the "Rotate" object from the annotation. To support users adding text annotations while using a PDF viewer, you can also add any viewer rotation to the annotations Rotate object, to have text always rotated correctly, from the users perspective.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### RefreshAppearance(RefreshOptions)

A version of RefreshAppearance allowing custom options to make slight tweaks in behaviour.

##### Declaration

    public void RefreshAppearance(RefreshOptions options)

##### Parameters

Type | Name | Description
--- | --- | ---
RefreshOptions | options | The RefreshOptions.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### RemoveAppearance()

Removes the annotation's appearance

##### Declaration

    public void RemoveAppearance()

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception
PDFNetException | PDFNetException the PDFNet exception
PDFNetException | PDFNetException the PDFNet exception
PDFNetException | PDFNetException the PDFNet exception
PDFNetException | PDFNetException the PDFNet exception

#### RemoveAppearance(AnnotationState)

Removes the annotation's appearance for the given combination of annotation and appearance states.

##### Declaration

    public void RemoveAppearance(Annot.AnnotationState annot_state)

##### Parameters

Type | Name | Description
--- | --- | ---
Annot.AnnotationState | annot_state | the annotation's appearance state, which selects the applicable appearance stream from the appearance sub-dictionary. An annotation can define as many as three separate appearances: The normal, rollover, and down appearance.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the pDF net exception

#### RemoveAppearance(AnnotationState, string)

Removes the annotation's appearance for the given combination of annotation and appearance states.

##### Declaration

    public void RemoveAppearance(Annot.AnnotationState annot_state, string app_state)

##### Parameters

Type | Name | Description
--- | --- | ---
Annot.AnnotationState | annot_state | the annotation's appearance state, which selects the applicable appearance stream from the appearance sub-dictionary. An annotation can define as many as three separate appearances: The normal, rollover, and down appearance.
string | app_state | is an optional parameter specifying the appearance state (e.g. "Off", "On", etc) under which the new appearance should be stored. If appearance_state is NULL, the annotation will have only one annotaion state.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### Resize(Rect)

##### Declaration

    public void Resize(Rect newrect)

##### Parameters

Type | Name | Description
--- | --- | ---
Rect | newrect |

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception
PDFNetException | PDFNetException the PDFNet exception
PDFNetException | PDFNetException the PDFNet exception
PDFNetException | PDFNetException the PDFNet exception
PDFNetException | PDFNetException the PDFNet exception

#### SetActiveAppearanceState(string)

Sets the annotation's active appearance state. (Required if the appearance dictionary AP contains one or more subdictionaries; PDF'1.2)

##### Declaration

    public void SetActiveAppearanceState(string astate)

##### Parameters

Type | Name | Description
--- | --- | ---
string | astate | astate Charactor string representing the name of the active appearance state. The string used to select the annotation's appearance state, which selects the applicable appearance stream from an appearance subdictionary.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### SetAppearance(Obj)

Sets the annotation's appearance for the given combination of annotation and appearance states. (Optional; PDF'1.2)

##### Declaration

    public void SetAppearance(Obj app_stream)

##### Parameters

Type | Name | Description
--- | --- | ---
Obj | app_stream | a content stream defining the new appearance.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### SetAppearance(Obj, AnnotationState)

Removes the annotation's appearance for the given combination of annotation and appearance states.

##### Declaration

    public void SetAppearance(Obj app_stream, Annot.AnnotationState annot_state)

##### Parameters

Type | Name | Description
--- | --- | ---
Obj | app_stream | a content stream defining the new appearance.
Annot.AnnotationState | annot_state | is an optional parameter specifying the appearance state (e.g. "Off", "On", etc) under which the new appearance should be stored. If appearance_state is NULL, the annotation will have only one annotaion state.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### SetAppearance(Obj, AnnotationState, string)

Sets the annotation's appearance for the given combination of annotation and appearance states. (Optional; PDF'1.2)

##### Declaration

    public void SetAppearance(Obj app_stream, Annot.AnnotationState annot_state, string app_state)

##### Parameters

Type | Name | Description
--- | --- | ---
Obj | app_stream | a content stream defining the new appearance.
Annot.AnnotationState | annot_state | the annotation's appearance state, which selects the applicable appearance stream from the appearance sub-dictionary. An annotation can define as many as three separate appearances: The normal, rollover, and down appearance.
string | app_state | is an optional parameter specifying the appearance state (e.g. "Off", "On", etc) under which the new appearance should be stored. If appearance_state is NULL, the annotation will have only one annotaion state.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### SetBorderStyle(BorderStyle)

Sets the border style for the annotation. Typically used for Link annotations.

##### Declaration

    public void SetBorderStyle(Annot.BorderStyle bs)

##### Parameters

Type | Name | Description
--- | --- | ---
Annot.BorderStyle | bs | New border style for this annotation.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the pDF net exception

#### SetColor(ColorPt)

Sets an annotation's color. (Optional; PDF'1.1)

##### Declaration

    public void SetColor(ColorPt cpt)

##### Parameters

Type | Name | Description
--- | --- | ---
ColorPt | cpt | the color point

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### SetColor(ColorPt, int)

Sets an annotation's color. (Optional; PDF'1.1)

##### Declaration

    public void SetColor(ColorPt cpt, int comp_num)

##### Parameters

Type | Name | Description
--- | --- | ---
ColorPt | cpt | the color point
int | comp_num | The color component number that indirectly implies the color space the color is from.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### SetContents(string)

Sets the contents.

##### Declaration

    public void SetContents(string contents)

##### Parameters

Type | Name | Description
--- | --- | ---
string | contents | the new contents

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### SetCustomData(string, string)

Sets the custom data associated with the specified key.

##### Declaration

    public void SetCustomData(string key, string value)

##### Parameters

Type | Name | Description
--- | --- | ---
string | key | The key under which to store this custom data.
string | value | The custom data string to store.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### SetDate(Date)

Sets an annotation's last modified date.

##### Declaration

    public void SetDate(Date date)

##### Parameters

Type | Name | Description
--- | --- | ---
Date | date | The annotation's last modified time and date. Corresponds to the "M" entry of the annotation dictionary.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### SetFlag(Flag, bool)

Sets the value of given Flag.

##### Declaration

    public void SetFlag(Annot.Flag flag, bool value)

##### Parameters

Type | Name | Description
--- | --- | ---
Annot.Flag | flag | The Flag property to modify.
bool | value | The new value for the property.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### SetOptionalContent(Obj)

Sets optional content of an annotation. (Optional, PDF1.5).

##### Declaration

    public void SetOptionalContent(Obj oc)

##### Parameters

Type | Name | Description
--- | --- | ---
Obj | oc | An SDF object corresponding to the optional content, a PDF::OCG::Group or membership dictionary specifying the PDF::OCG::Group properties for the annotation. Before the annotation is drawn, its visibility shall be determined based on this entry as well as the annotation flags specified in the Flag entry . If it is determined to be invisible, the annotation shall be skipped, as if it were not in the document.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception
PDFNetException | PDFNetException the PDFNet exception
PDFNetException | PDFNetException the PDFNet exception
PDFNetException | PDFNetException the PDFNet exception
PDFNetException | PDFNetException the PDFNet exception

#### SetPage(Page)

Sets the reference to a page the annotation is associated with. (Optional PDF'1.3; not used in FDF files)

##### Declaration

    public void SetPage(Page page)

##### Parameters

Type | Name | Description
--- | --- | ---
Page | page | the new page

##### Remarks

The parameter should be an indirect reference to the page object with which this annotation is associated. This entry shall be present in screen annotations associated with rendition actions

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### SetRect(Rect)

Sets the size and location of an annotation on its page.

##### Declaration

    public void SetRect(Rect pos)

##### Parameters

Type | Name | Description
--- | --- | ---
Rect | pos | the new rect

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### SetRotation(int)

Sets the rotation value of the Annotation. the Rotation specifies the number of degrees by which the annotation shall be rotated counterclockwise relative to the page. The value shall be a multiple of 90. (Optional)

##### Declaration

    public void SetRotation(int rot)

##### Parameters

Type | Name | Description
--- | --- | ---
int | rot | An integer representing the rotation value of the annotation.

##### Remarks

This property is part of the appearance characteristics dictionary, this dictionary that shall be used in constructing a dynamic appearance stream specifying the annotation's visual presentation on the page.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### SetStructParent(int)

Sets the struct parent of an annotation. (Required if the annotation is a structural content item; PDF'1.3)

##### Declaration

    public void SetStructParent(int keyval)

##### Parameters

Type | Name | Description
--- | --- | ---
int | keyval | An integer which is the integer key of the annotation's entry in the structural parent tree.

##### Remarks

The StructParent is the integer key of the annotation's entry in the structural parent tree.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### SetUniqueID(string)

Sets the unique identifier for this annotation.

##### Declaration

    public void SetUniqueID(string data)

##### Parameters

Type | Name | Description
--- | --- | ---
string | data | the new unique id

##### Remarks

It is necessary to ensure that the unique ID generated is actually unique.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### op_Assign(Annot)

Assignment operator

##### Declaration

    public Annot op_Assign(Annot r)

##### Parameters

Type | Name | Description
--- | --- | ---
Annot | r | a `Annot` object

##### Returns

Type | Description
--- | ---
Annot | a `Annot`object equals to the given one

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception
PDFNetException | PDFNetException the PDFNet exception
PDFNetException | PDFNetException the PDFNet exception
PDFNetException | PDFNetException the PDFNet exception
PDFNetException | PDFNetException the PDFNet exception

### Operators

#### operator ==(Annot, Annot)

Equality operator checks whether two Annot objects are the same

##### Declaration

    public static bool operator ==(Annot l, Annot r)

##### Parameters

Type | Name | Description
--- | --- | ---
Annot | l | the `Annot` object on the left of operator
Annot | r | the `Annot` object on the right of operator

##### Returns

Type | Description
--- | ---
bool | true if both objects are equal, false otherwise

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception
PDFNetException | PDFNetException the PDFNet exception
PDFNetException | PDFNetException the PDFNet exception
PDFNetException | PDFNetException the PDFNet exception
PDFNetException | PDFNetException the PDFNet exception

#### operator !=(Annot, Annot)

Inequality operator checks whether two Annot objects are different

##### Declaration

    public static bool operator !=(Annot l, Annot r)

##### Parameters

Type | Name | Description
--- | --- | ---
Annot | l | the `Annot` object on the left of operator
Annot | r | the `Annot` object on the right of operator

##### Returns

Type | Description
--- | ---
bool | true if both objects are not equal, false otherwise

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception
PDFNetException | PDFNetException the PDFNet exception
PDFNetException | PDFNetException the PDFNet exception
PDFNetException | PDFNetException the PDFNet exception
PDFNetException | PDFNetException the PDFNet exception

### Implements

IDisposable