PdfAnnots Object


PdfAnnots is a collection of PdfAnnot objects. This object is returned by PdfPages' Annots property as well as PdfDocument's Form property.

Member List


int Count (Read-only)

Returns the number of items in the collection.

PdfAnnot Item[int Index] (Read-only)

This is the default parameterized property. Returns a PdfAnnot object from the collection specified by a 1-based Index.


PdfAnnot Add(string Contents, object Param)
PdfAnnot Add(string Contents, object Param, string Name)
PdfAnnot Add(string Contents, object Param, string Name, string Path)

Adds a new annotation to the collection. Returns a PdfAnnot object representing the newly created annotation.

Contents specifies the annotation contents, such as text displayed in a pop-up window when the annotation is opened.

Param is a parameter object or parameter string specifying the annotation type and other parameters.

Name specifies annotation-specific information

Path specifies a file path to be used with FileAttachment annotations and is ignored by all other annotation types.

The Add method is described in detail in Section 10.3.2 - Add Method Parameters.


Set Annot = Page.Annots.Add("Hello world", "type=text;x=10;y=400;width=100;height=50")

void Remove(int Index)
Removes an annotation specified by Index from the collection.