GemBox.Pdf
  • Overview
  • Examples
  • Free version
  • Support
  • Pricelist

    Show / Hide Table of Contents

    PdfAnnotationCollection Class

    Namespace:
    GemBox.Pdf.Annotations
    Assembly:
    GemBox.Pdf.dll

    Represents a collection of PdfAnnotations.

    • C#
    • VB.NET
    public sealed class PdfAnnotationCollection : PdfOptionalCollection<PdfAnnotation>, IList, ICollection, IList<PdfAnnotation>, ICollection<PdfAnnotation>, IReadOnlyList<PdfAnnotation>, IReadOnlyCollection<PdfAnnotation>, IEnumerable<PdfAnnotation>, IEnumerable
    Public NotInheritable Class PdfAnnotationCollection
        Inherits PdfOptionalCollection(Of PdfAnnotation)
        Implements IList, ICollection, IList(Of PdfAnnotation), ICollection(Of PdfAnnotation), IReadOnlyList(Of PdfAnnotation), IReadOnlyCollection(Of PdfAnnotation), IEnumerable(Of PdfAnnotation), IEnumerable
    Inheritance:
    System.Object
    PdfObject
    PdfCollection
    PdfCollection<PdfAnnotation>
    PdfOptionalCollection<PdfAnnotation>
    PdfAnnotationCollection
    Implements
    System.Collections.IList
    System.Collections.ICollection
    System.Collections.Generic.IList<PdfAnnotation>
    System.Collections.Generic.ICollection<PdfAnnotation>
    System.Collections.Generic.IReadOnlyList<PdfAnnotation>
    System.Collections.Generic.IReadOnlyCollection<PdfAnnotation>
    System.Collections.Generic.IEnumerable<PdfAnnotation>
    System.Collections.IEnumerable

    Methods

    AddCaret(Double, Double, Double, Double)

    Adds a PdfCaretAnnotation to the PdfAnnotationCollection.

    • C#
    • VB.NET
    public PdfCaretAnnotation AddCaret(double left, double bottom, double width, double height)
    Public Function AddCaret(left As Double, bottom As Double, width As Double, height As Double) As PdfCaretAnnotation
    Parameters
    left
    System.Double

    The lower-left horizontal coordinate of the PdfCaretAnnotation bounds specified in default user space units.

    bottom
    System.Double

    The lower-left vertical coordinate of the PdfCaretAnnotation bounds specified in default user space units.

    width
    System.Double

    The width of the PdfCaretAnnotation bounds specified in default user space units.

    height
    System.Double

    The height of the PdfCaretAnnotation bounds specified in default user space units.

    Returns
    PdfCaretAnnotation

    A new PdfCaretAnnotation added to the PdfAnnotationCollection.

    AddCircle(String, Double, Double, Double, Double)

    Adds an oval PdfSquareCircleAnnotation to the PdfAnnotationCollection.

    • C#
    • VB.NET
    public PdfSquareCircleAnnotation AddCircle(string author, double left, double bottom, double right, double top)
    Public Function AddCircle(author As String, left As Double, bottom As Double, right As Double, top As Double) As PdfSquareCircleAnnotation
    Parameters
    author
    System.String

    Identification of the user who added the oval PdfSquareCircleAnnotation.

    left
    System.Double

    The lower-left horizontal coordinate of the oval PdfSquareCircleAnnotation bounds specified in default user space units.

    bottom
    System.Double

    The lower-left vertical coordinate of the oval PdfSquareCircleAnnotation bounds specified in default user space units.

    right
    System.Double

    The upper-right horizontal coordinate of the oval PdfSquareCircleAnnotation bounds specified in default user space units.

    top
    System.Double

    The upper-right vertical coordinate of the oval PdfSquareCircleAnnotation bounds specified in default user space units.

    Returns
    PdfSquareCircleAnnotation

    A new oval PdfSquareCircleAnnotation added to the PdfAnnotationCollection.

    AddCrossOut(PdfQuad)

    Adds a strikeout PdfTextMarkupAnnotation to the PdfAnnotationCollection.

    • C#
    • VB.NET
    public PdfTextMarkupAnnotation AddCrossOut(PdfQuad bounds)
    Public Function AddCrossOut(bounds As PdfQuad) As PdfTextMarkupAnnotation
    Parameters
    bounds
    PdfQuad

    The bounds of the strikeout PdfTextMarkupAnnotation specified in default user space units.

    Returns
    PdfTextMarkupAnnotation

    A new strikeout PdfTextMarkupAnnotation added to the PdfAnnotationCollection.

    AddCrossOut(Double, Double, Double, Double)

    Adds a strikeout PdfTextMarkupAnnotation to the PdfAnnotationCollection.

    • C#
    • VB.NET
    public PdfTextMarkupAnnotation AddCrossOut(double left, double bottom, double width, double height)
    Public Function AddCrossOut(left As Double, bottom As Double, width As Double, height As Double) As PdfTextMarkupAnnotation
    Parameters
    left
    System.Double

    The lower-left horizontal coordinate of the strikeout PdfTextMarkupAnnotation bounds specified in default user space units.

    bottom
    System.Double

    The lower-left vertical coordinate of the strikeout PdfTextMarkupAnnotation bounds specified in default user space units.

    width
    System.Double

    The width of the strikeout PdfTextMarkupAnnotation bounds specified in default user space units.

    height
    System.Double

    The height of the strikeout PdfTextMarkupAnnotation bounds specified in default user space units.

    Returns
    PdfTextMarkupAnnotation

    A new strikeout PdfTextMarkupAnnotation added to the PdfAnnotationCollection.

    AddEmptyFileAttachment(Double, Double, String)

    Adds a PdfFileAttachmentAnnotation to the PdfAnnotationCollection with the associated file created from the specified fileSpecificationName with an empty EmbeddedFile.

    The Paperclip whose size is 7 pt x 17 pt is used for an appearance of a newly added PdfFileAttachmentAnnotation.

    • C#
    • VB.NET
    public PdfFileAttachmentAnnotation AddEmptyFileAttachment(double left, double bottom, string fileSpecificationName)
    Public Function AddEmptyFileAttachment(left As Double, bottom As Double, fileSpecificationName As String) As PdfFileAttachmentAnnotation
    Parameters
    left
    System.Double

    The lower-left horizontal coordinate of the PdfFileAttachmentAnnotation bounds specified in default user space units.

    bottom
    System.Double

    The lower-left vertical coordinate of the PdfFileAttachmentAnnotation bounds specified in default user space units.

    fileSpecificationName
    System.String

    The name of the file with an empty EmbeddedFile associated with a newly added PdfFileAttachmentAnnotation.

    Returns
    PdfFileAttachmentAnnotation

    A new PdfFileAttachmentAnnotation added to the PdfAnnotationCollection.

    Exceptions
    System.ArgumentNullException

    fileSpecificationName is null or System.String.Empty.

    AddFileAttachment(Double, Double, String)

    Adds a PdfFileAttachmentAnnotation to the PdfAnnotationCollection with the associated file copied from the resource specified by the filePath.

    The Paperclip whose size is 7 pt x 17 pt is used for an appearance of a newly added PdfFileAttachmentAnnotation.

    • C#
    • VB.NET
    public PdfFileAttachmentAnnotation AddFileAttachment(double left, double bottom, string filePath)
    Public Function AddFileAttachment(left As Double, bottom As Double, filePath As String) As PdfFileAttachmentAnnotation
    Parameters
    left
    System.Double

    The lower-left horizontal coordinate of the PdfFileAttachmentAnnotation bounds specified in default user space units.

    bottom
    System.Double

    The lower-left vertical coordinate of the PdfFileAttachmentAnnotation bounds specified in default user space units.

    filePath
    System.String

    The location of the resource copied to the file associated with a newly added PdfFileAttachmentAnnotation. This value is also used to resolve the Name of the associated file.

    Returns
    PdfFileAttachmentAnnotation

    A new PdfFileAttachmentAnnotation added to the PdfAnnotationCollection.

    Exceptions
    System.ArgumentNullException

    filePath is null or System.String.Empty.

    AddHighlight(PdfQuad)

    Adds a highlight PdfTextMarkupAnnotation to the PdfAnnotationCollection.

    • C#
    • VB.NET
    public PdfTextMarkupAnnotation AddHighlight(PdfQuad bounds)
    Public Function AddHighlight(bounds As PdfQuad) As PdfTextMarkupAnnotation
    Parameters
    bounds
    PdfQuad

    The bounds of the highlight PdfTextMarkupAnnotation specified in default user space units.

    Returns
    PdfTextMarkupAnnotation

    A new highlight PdfTextMarkupAnnotation added to the PdfAnnotationCollection.

    AddHighlight(Double, Double, Double, Double)

    Adds a highlight PdfTextMarkupAnnotation to the PdfAnnotationCollection.

    • C#
    • VB.NET
    public PdfTextMarkupAnnotation AddHighlight(double left, double bottom, double width, double height)
    Public Function AddHighlight(left As Double, bottom As Double, width As Double, height As Double) As PdfTextMarkupAnnotation
    Parameters
    left
    System.Double

    The lower-left horizontal coordinate of the highlight PdfTextMarkupAnnotation bounds specified in default user space units.

    bottom
    System.Double

    The lower-left vertical coordinate of the highlight PdfTextMarkupAnnotation bounds specified in default user space units.

    width
    System.Double

    The width of the highlight PdfTextMarkupAnnotation bounds specified in default user space units.

    height
    System.Double

    The height of the highlight PdfTextMarkupAnnotation bounds specified in default user space units.

    Returns
    PdfTextMarkupAnnotation

    A new highlight PdfTextMarkupAnnotation added to the PdfAnnotationCollection.

    AddLink(Double, Double, Double, Double)

    Adds a PdfLinkAnnotation to the PdfAnnotationCollection.

    • C#
    • VB.NET
    public PdfLinkAnnotation AddLink(double left, double bottom, double width, double height)
    Public Function AddLink(left As Double, bottom As Double, width As Double, height As Double) As PdfLinkAnnotation
    Parameters
    left
    System.Double

    The lower-left horizontal coordinate of the PdfLinkAnnotation bounds specified in default user space units.

    bottom
    System.Double

    The lower-left vertical coordinate of the PdfLinkAnnotation bounds specified in default user space units.

    width
    System.Double

    The width of the PdfLinkAnnotation bounds specified in default user space units.

    height
    System.Double

    The height of the PdfLinkAnnotation bounds specified in default user space units.

    Returns
    PdfLinkAnnotation

    A new PdfLinkAnnotation added to the PdfAnnotationCollection.

    AddOval(Double, Double, Double, Double)

    Adds an oval PdfSquareCircleAnnotation to the PdfAnnotationCollection.

    • C#
    • VB.NET
    public PdfSquareCircleAnnotation AddOval(double left, double bottom, double width, double height)
    Public Function AddOval(left As Double, bottom As Double, width As Double, height As Double) As PdfSquareCircleAnnotation
    Parameters
    left
    System.Double

    The lower-left horizontal coordinate of the oval PdfSquareCircleAnnotation bounds specified in default user space units.

    bottom
    System.Double

    The lower-left vertical coordinate of the oval PdfSquareCircleAnnotation bounds specified in default user space units.

    width
    System.Double

    The width of the oval PdfSquareCircleAnnotation bounds specified in default user space units.

    height
    System.Double

    The height of the oval PdfSquareCircleAnnotation bounds specified in default user space units.

    Returns
    PdfSquareCircleAnnotation

    A new oval PdfSquareCircleAnnotation added to the PdfAnnotationCollection.

    AddPencilMark(Double, Double, Double, Double)

    Adds a PdfPencilMarkAnnotation to the PdfAnnotationCollection.

    • C#
    • VB.NET
    public PdfPencilMarkAnnotation AddPencilMark(double left, double bottom, double width, double height)
    Public Function AddPencilMark(left As Double, bottom As Double, width As Double, height As Double) As PdfPencilMarkAnnotation
    Parameters
    left
    System.Double

    The lower-left horizontal coordinate of the PdfRedactionAnnotation bounds specified in default user space units.

    bottom
    System.Double

    The lower-left vertical coordinate of the PdfRedactionAnnotation bounds specified in default user space units.

    width
    System.Double

    The width of the PdfRedactionAnnotation bounds specified in default user space units.

    height
    System.Double

    The height of the PdfRedactionAnnotation bounds specified in default user space units.

    Returns
    PdfPencilMarkAnnotation

    A new PdfPencilMarkAnnotation added to the PdfAnnotationCollection.

    AddRectangle(Double, Double, Double, Double)

    Adds a rectangular PdfSquareCircleAnnotation to the PdfAnnotationCollection.

    • C#
    • VB.NET
    public PdfSquareCircleAnnotation AddRectangle(double left, double bottom, double width, double height)
    Public Function AddRectangle(left As Double, bottom As Double, width As Double, height As Double) As PdfSquareCircleAnnotation
    Parameters
    left
    System.Double

    The lower-left horizontal coordinate of the rectangular PdfSquareCircleAnnotation bounds specified in default user space units.

    bottom
    System.Double

    The lower-left vertical coordinate of the rectangular PdfSquareCircleAnnotation bounds specified in default user space units.

    width
    System.Double

    The width of the rectangular PdfSquareCircleAnnotation bounds specified in default user space units.

    height
    System.Double

    The height of the rectangular PdfSquareCircleAnnotation bounds specified in default user space units.

    Returns
    PdfSquareCircleAnnotation

    A new rectangular PdfSquareCircleAnnotation added to the PdfAnnotationCollection.

    AddRedaction(Double, Double, Double, Double)

    Adds a PdfRedactionAnnotation to the PdfAnnotationCollection.

    • C#
    • VB.NET
    public PdfRedactionAnnotation AddRedaction(double left, double bottom, double width, double height)
    Public Function AddRedaction(left As Double, bottom As Double, width As Double, height As Double) As PdfRedactionAnnotation
    Parameters
    left
    System.Double

    The lower-left horizontal coordinate of the PdfRedactionAnnotation bounds specified in default user space units.

    bottom
    System.Double

    The lower-left vertical coordinate of the PdfRedactionAnnotation bounds specified in default user space units.

    width
    System.Double

    The width of the PdfRedactionAnnotation bounds specified in default user space units.

    height
    System.Double

    The height of the PdfRedactionAnnotation bounds specified in default user space units.

    Returns
    PdfRedactionAnnotation

    A new PdfRedactionAnnotation added to the PdfAnnotationCollection.

    AddSquare(String, Double, Double, Double, Double)

    Adds a rectangular PdfSquareCircleAnnotation to the PdfAnnotationCollection.

    • C#
    • VB.NET
    public PdfSquareCircleAnnotation AddSquare(string author, double left, double bottom, double right, double top)
    Public Function AddSquare(author As String, left As Double, bottom As Double, right As Double, top As Double) As PdfSquareCircleAnnotation
    Parameters
    author
    System.String

    Identification of the user who added the rectangular PdfSquareCircleAnnotation.

    left
    System.Double

    The lower-left horizontal coordinate of the rectangular PdfSquareCircleAnnotation bounds specified in default user space units.

    bottom
    System.Double

    The lower-left vertical coordinate of the rectangular PdfSquareCircleAnnotation bounds specified in default user space units.

    right
    System.Double

    The upper-right horizontal coordinate of the rectangular PdfSquareCircleAnnotation bounds specified in default user space units.

    top
    System.Double

    The upper-right vertical coordinate of the rectangular PdfSquareCircleAnnotation bounds specified in default user space units.

    Returns
    PdfSquareCircleAnnotation

    A new rectangular PdfSquareCircleAnnotation added to the PdfAnnotationCollection.

    AddStamp(Double, Double, Double, Double, PdfStampIcon)

    Adds a PdfStampAnnotation to the PdfAnnotationCollection with the specified stamp appearance icon.

    • C#
    • VB.NET
    public PdfStampAnnotation AddStamp(double left, double bottom, double width, double height, PdfStampIcon icon)
    Public Function AddStamp(left As Double, bottom As Double, width As Double, height As Double, icon As PdfStampIcon) As PdfStampAnnotation
    Parameters
    left
    System.Double

    The lower-left horizontal coordinate of the PdfStampAnnotation bounds specified in default user space units.

    bottom
    System.Double

    The lower-left vertical coordinate of the PdfStampAnnotation bounds specified in default user space units.

    width
    System.Double

    The width of the PdfStampAnnotation bounds specified in default user space units or non-positive value to use the default icon width.

    height
    System.Double

    The height of the PdfStampAnnotation bounds specified in default user space units or non-positive value to use the default icon height.

    icon
    PdfStampIcon

    The icon used in displaying the PdfStampAnnotation.

    Returns
    PdfStampAnnotation

    A new PdfStampAnnotation added to the PdfAnnotationCollection.

    AddStickyNote(Double, Double)

    Adds a PdfStickyNoteAnnotation to the PdfAnnotationCollection.

    The Comment whose size is 24 pt x 24 pt is used for an appearance of a newly added PdfStickyNoteAnnotation.

    • C#
    • VB.NET
    public PdfStickyNoteAnnotation AddStickyNote(double left, double bottom)
    Public Function AddStickyNote(left As Double, bottom As Double) As PdfStickyNoteAnnotation
    Parameters
    left
    System.Double

    The lower-left horizontal coordinate of the PdfStickyNoteAnnotation bounds specified in default user space units.

    bottom
    System.Double

    The lower-left vertical coordinate of the PdfStickyNoteAnnotation bounds specified in default user space units.

    Returns
    PdfStickyNoteAnnotation

    A new PdfStickyNoteAnnotation added to the PdfAnnotationCollection.

    AddTextBox(Double, Double, Double, Double)

    Adds a text box PdfFreeTextAnnotation to the PdfAnnotationCollection.

    • C#
    • VB.NET
    public PdfFreeTextAnnotation AddTextBox(double left, double bottom, double width, double height)
    Public Function AddTextBox(left As Double, bottom As Double, width As Double, height As Double) As PdfFreeTextAnnotation
    Parameters
    left
    System.Double

    The lower-left horizontal coordinate of the text box PdfFreeTextAnnotation bounds specified in default user space units.

    bottom
    System.Double

    The lower-left vertical coordinate of the text box PdfFreeTextAnnotation bounds specified in default user space units.

    width
    System.Double

    The width of the text box PdfFreeTextAnnotation bounds specified in default user space units.

    height
    System.Double

    The height of the text box PdfFreeTextAnnotation bounds specified in default user space units.

    Returns
    PdfFreeTextAnnotation

    A new text box PdfFreeTextAnnotation added to the PdfAnnotationCollection.

    AddTextComment(Double, Double, Double, Double)

    Adds a text comment PdfFreeTextAnnotation to the PdfAnnotationCollection.

    • C#
    • VB.NET
    public PdfFreeTextAnnotation AddTextComment(double left, double bottom, double width, double height)
    Public Function AddTextComment(left As Double, bottom As Double, width As Double, height As Double) As PdfFreeTextAnnotation
    Parameters
    left
    System.Double

    The lower-left horizontal coordinate of the text comment PdfFreeTextAnnotation bounds specified in default user space units.

    bottom
    System.Double

    The lower-left vertical coordinate of the text comment PdfFreeTextAnnotation bounds specified in default user space units.

    width
    System.Double

    The width of the text comment PdfFreeTextAnnotation bounds specified in default user space units.

    height
    System.Double

    The height of the text comment PdfFreeTextAnnotation bounds specified in default user space units.

    Returns
    PdfFreeTextAnnotation

    A new text comment PdfFreeTextAnnotation added to the PdfAnnotationCollection.

    AddUnderline(PdfQuad)

    Adds an underline PdfTextMarkupAnnotation to the PdfAnnotationCollection.

    • C#
    • VB.NET
    public PdfTextMarkupAnnotation AddUnderline(PdfQuad bounds)
    Public Function AddUnderline(bounds As PdfQuad) As PdfTextMarkupAnnotation
    Parameters
    bounds
    PdfQuad

    The bounds of the underline PdfTextMarkupAnnotation specified in default user space units.

    Returns
    PdfTextMarkupAnnotation

    A new underline PdfTextMarkupAnnotation added to the PdfAnnotationCollection.

    AddUnderline(Double, Double, Double, Double)

    Adds an underline PdfTextMarkupAnnotation to the PdfAnnotationCollection.

    • C#
    • VB.NET
    public PdfTextMarkupAnnotation AddUnderline(double left, double bottom, double width, double height)
    Public Function AddUnderline(left As Double, bottom As Double, width As Double, height As Double) As PdfTextMarkupAnnotation
    Parameters
    left
    System.Double

    The lower-left horizontal coordinate of the underline PdfTextMarkupAnnotation bounds specified in default user space units.

    bottom
    System.Double

    The lower-left vertical coordinate of the underline PdfTextMarkupAnnotation bounds specified in default user space units.

    width
    System.Double

    The width of the underline PdfTextMarkupAnnotation bounds specified in default user space units.

    height
    System.Double

    The height of the underline PdfTextMarkupAnnotation bounds specified in default user space units.

    Returns
    PdfTextMarkupAnnotation

    A new underline PdfTextMarkupAnnotation added to the PdfAnnotationCollection.

    ApplyRedactions()

    Performs the Content removal phase of the redaction process after which the content in the area specified (either via Quads or Bounds) by all PdfRedactionAnnotations contained in this PdfAnnotationCollection is removed. In the removed content's place, some marking appears to indicate the area has been redacted as specified by the RedactedAreaFillColor, OverlayText, and related properties. Also, all PdfRedactionAnnotations (and their associated pop-up annotations) are removed from this PdfAnnotationCollection. If a portion of a content (either text, path, image, or form) is contained in a redaction region, that portion of the content is destroyed; clipping or image masks are not used to hide that content.

    • C#
    • VB.NET
    public void ApplyRedactions()
    Public Sub ApplyRedactions
    See Also
    PDF Specification ISO 32000-1:2008, section '12.5.6.23 Redaction Annotations'

    Inherited Properties

    Count

    Gets the number of elements contained in the PdfCollection.

    (Inherited from PdfCollection)

    Metadata

    (Optional; PDF 1.4) A metadata stream containing metadata for the component.

    (Inherited from PdfObject)

    Inherited Methods

    Clear()

    Removes all elements from the PdfCollection.

    (Inherited from PdfCollection)

    RemoveAt(System.Int32)

    Removes the element at the specified index of the PdfCollection.

    (Inherited from PdfCollection)

    Implements

    System.Collections.IList
    System.Collections.ICollection
    System.Collections.Generic.IList<T>
    System.Collections.Generic.ICollection<T>
    System.Collections.Generic.IReadOnlyList<T>
    System.Collections.Generic.IReadOnlyCollection<T>
    System.Collections.Generic.IEnumerable<T>
    System.Collections.IEnumerable

    Extension Methods

    PdfObjectExtensions.GetDictionary(PdfObject)
    PdfObjectExtensions.GetOrAddDictionary(PdfObject)
    PdfObjectExtensions.GetArray(PdfObject)
    PdfObjectExtensions.GetArray(PdfCollection)
    PdfObjectExtensions.GetOrAddArray(PdfCollection)

    Examples

    File Attachment Annotations example
    File Attachment Annotations example

    See Also

    PDF Specification ISO 32000-1:2008, section '12.5 Annotations'
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.