[]
        
(Showing Draft Content)

GrapeCity.Documents.Pdf.Annotations.AnnotationBase

Class AnnotationBase

Namespace
GrapeCity.Documents.Pdf.Annotations
Assembly
GcDocs.Pdf.dll

The abstract base class for all PDF annotation types.

public abstract class AnnotationBase : PdfDictWrapper, IOwnedObject, IContentItem, IPdfDict
Inheritance
object
AnnotationBase
Implements
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Extension Methods

Properties

AppearanceState

Gets or sets the annotation’s appearance state, which selects the applicable appearance stream from an appearance sub-dictionary. Note! If you change this property then GcPdf will NOT automatically generates appearance content streams in AppearanceStreams. See PDF specification for more details.

public string AppearanceState { get; set; }

Property Value

string

AppearanceStreams

Gets the AppearanceStreams object that allows defining this annotation's appearance streams.

public AppearanceStreams AppearanceStreams { get; }

Property Value

AppearanceStreams

AssociatedFiles

Gets the list of embedded files associated with this AnnotationBase.

public AssociatedFiles AssociatedFiles { get; }

Property Value

AssociatedFiles

Contents

Gets or sets the text to be displayed for the annotation or, if this type of annotation does not display text, an alternate description of the annotation’s contents in human-readable form. In either case, this text is useful when extracting the document’s contents in support of accessibility to users with disabilities or for other purposes.

public string Contents { get; set; }

Property Value

string

Doc

Gets the GcPdfDocument owning this annotation.

public GcPdfDocument Doc { get; }

Property Value

GcPdfDocument

Flags

Gets or sets the flags specifying various characteristics of the annotation.

public AnnotationFlags Flags { get; set; }

Property Value

AnnotationFlags

Layer

Gets or sets an object that specifies the layer to which this annotation belongs.

This can be either an OptionalContentGroup or an OptionalContentMembership.

public OptionalContentIdentifier Layer { get; set; }

Property Value

OptionalContentIdentifier

Locked

Gets or sets a value indicating whether the annotation can be deleted or its properties (including position and size) can 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.

public bool Locked { get; set; }

Property Value

bool

LockedContents

Gets or sets a value indicating whether the contents of the annotation can be modified by the user. This flag does not restrict deletion of the annotation or changes to other annotation properties, such as position and size.

public bool LockedContents { get; set; }

Property Value

bool

ModifiedDate

Gets or sets the date and time when the annotation was modified.

public PdfDateTime? ModifiedDate { get; set; }

Property Value

PdfDateTime?

Name

Gets or sets the annotation name, a text string uniquely identifying it among all annotations on its page.

public string Name { get; set; }

Property Value

string

Page

Gets or sets the Page that contains this annotation.

Note that an annotation may be referenced by several pages. In that case this property returns the first element in the Pages collection.

When setting this property, the following applies:

  • If the new value is null, this annotation is removed from all pages.
  • Otherwise, this annotation is assigned exclusively to the specified page.
public Page Page { get; set; }

Property Value

Page

Pages

Gets the list of pages that reference this annotation.

public IList<Page> Pages { get; }

Property Value

System.Collections.Generic.IList<T><Page>

PdfRect

Gets or sets the rectangle that defines the location and size of the annotation on a page in PDF user space coordinates. The positive X axis extends horizontally to the right, and the positive Y axis extends vertically upward, with the origin usually in the lower left corner of the page.

public RectangleF PdfRect { get; set; }

Property Value

System.Drawing.RectangleF
See Also

Rect

Gets or sets the rectangle that defines the location and size of the annotation on a page. The coordinates of the rectangle are relative to the upper left corner of the page's media box, with the Y (vertical) coordinates increasing from top to bottom.

Note that if the annotation is associated with more than one page, the media box of the first of those pages is used to calculate the rectangle's location.

public RectangleF Rect { get; set; }

Property Value

System.Drawing.RectangleF
See Also

UserData

Gets or sets arbitrary data associated with the current annotation.

Note that this data is runtime only and is not persisted in the PDF.

public object UserData { get; set; }

Property Value

object

Methods

CreateAppearanceContentStream()

Creates an instance of FormXObject that can be used to define the annotation's appearance stream.

Note that when this method is called, the annotation must already have been added to the document, otherwise an exception will be thrown.

public FormXObject CreateAppearanceContentStream()

Returns

FormXObject

The FormXObject object.

DisableAppearanceGeneration()

Disables generation of appearance steams for this annotation when the document is saved.

Note that if any property affecting the annotation's appearance (such as Rect) is then changed, the appearance streams will be regenerated. So this method would usually be called after initializing all annotation's properties.

public void DisableAppearanceGeneration()

RemoveAppearance()

Removes all appearance streams associated with the current annotation, and disables generation of appearance steams for this annotation when the document is saved.

Note that if any property affecting the annotation's appearance (such as Rect) is then changed, the appearance streams will be regenerated. So this method would usually be called after initializing all annotation's properties.

public void RemoveAppearance()

ResetAppearance()

Forces regeneration of the annotation's appearance streams next time the document is saved.

public void ResetAppearance()