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

    Show / Hide Table of Contents

    PdfAnnotation Class

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

    An annotation associates an object such as a note, link or rich media with a location on a page of a PDF document, or provides a way to interact with the user by means of the mouse and keyboard.

    • C#
    • VB.NET
    public abstract class PdfAnnotation : PdfObject
    Public MustInherit Class PdfAnnotation
        Inherits PdfObject
    Inheritance:
    Object
    PdfObject
    PdfAnnotation
    Derived
    PdfLinkAnnotation
    PdfMarkupAnnotation
    PdfField

    Properties

    AnnotationType

    Gets the type of the annotation.

    • C#
    • VB.NET
    public abstract PdfAnnotationType AnnotationType { get; }
    Public MustOverride ReadOnly Property AnnotationType As PdfAnnotationType
    Property Value
    PdfAnnotationType

    The type of the annotation.

    See Also
    PDF Specification ISO 32000-1:2008, section '12.5.6 Annotation Types'

    Appearance

    Gets the appearance settings for this PdfAnnotation.

    • C#
    • VB.NET
    public PdfAppearance Appearance { get; }
    Public ReadOnly Property Appearance As PdfAppearance
    Property Value
    PdfAppearance

    The appearance settings for this PdfAnnotation.

    AssociatedFiles

    (Optional; PDF 2.0) An array of one or more PdfFileSpecifications which denote the associated files for this PdfAnnotation.

    • C#
    • VB.NET
    public PdfAssociatedFileCollection AssociatedFiles { get; }
    Public ReadOnly Property AssociatedFiles As PdfAssociatedFileCollection
    Property Value
    PdfAssociatedFileCollection

    An array of one or more PdfFileSpecifications which denote the associated files for this PdfAnnotation.

    Bounds

    (Required) The annotation bounds, defining the location and the size of the annotation on the page in default user space units.

    • C#
    • VB.NET
    public PdfRectangle Bounds { get; set; }
    Public Property Bounds As PdfRectangle
    Property Value
    PdfRectangle

    The annotation bounds, defining the location and the size of the annotation on the page in default user space units.

    Exceptions
    ArgumentNullException

    Value is null.

    See Also
    PDF Specification ISO 32000-1:2008, section '12.5.2 Annotation Dictionaries'

    Locked

    (PDF 1.4) If set, do not allow the annotation to be deleted or its properties (including position and size) to be modified by the user. However, this flag does not restrict changes to the annotation's contents, such as the value of a form field.

    • C#
    • VB.NET
    public bool Locked { get; set; }
    Public Property Locked As Boolean
    Property Value
    Boolean

    If set, do not allow the annotation to be deleted or its properties (including position and size) to be modified by the user.

    See Also
    PDF Specification ISO 32000-1:2008, section '12.5.3 Annotation Flags'

    Page

    Gets the page with which this annotation is associated.

    • C#
    • VB.NET
    public PdfPage Page { get; }
    Public ReadOnly Property Page As PdfPage
    Property Value
    PdfPage

    The page with which this annotation is associated.

    See Also
    PDF Specification ISO 32000-1:2008, section '12.5.2 Annotation Dictionaries'

    Methods

    SetBounds(Double, Double)

    Sets the size of the Bounds.

    • C#
    • VB.NET
    public void SetBounds(double width, double height)
    Public Sub SetBounds(width As Double, height As Double)
    Parameters
    width
    Double

    The width of the Bounds.

    height
    Double

    The height of the Bounds.

    Exceptions
    ArgumentException

    width or height is either NaN, NegativeInfinity or PositiveInfinity.

    ArgumentOutOfRangeException

    width or height is less than zero.

    SetBounds(Double, Double, Double, Double)

    Sets the Bounds.

    • C#
    • VB.NET
    public void SetBounds(double left, double bottom, double right, double top)
    Public Sub SetBounds(left As Double, bottom As Double, right As Double, top As Double)
    Parameters
    left
    Double

    The left X coordinate of the Bounds.

    bottom
    Double

    The bottom Y coordinate of the Bounds.

    right
    Double

    The right X coordinate of the Bounds.

    top
    Double

    The top Y coordinate of the Bounds.

    Exceptions
    ArgumentException

    left, bottom, right or top is either NaN, NegativeInfinity or PositiveInfinity.

    Inherited Properties

    Metadata

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

    (Inherited from PdfObject)

    Extension Methods

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

    Examples

    Associated Files example

    See Also

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

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.