PDFsharp-net6

PdfAnnotations

Namespace: PdfSharp.Pdf.Annotations

Represents the annotations array of a page.

public sealed class PdfAnnotations : PdfSharp.Pdf.PdfArray, System.ICloneable, System.Collections.Generic.IEnumerable`1[[PdfSharp.Pdf.PdfItem, PdfSharp, Version=0.1.3.0, Culture=neutral, PublicKeyToken=null]], System.Collections.IEnumerable

Inheritance ObjectPdfItemPdfObjectPdfArrayPdfAnnotations
Implements ICloneable, IEnumerable<PdfItem>, IEnumerable

Properties

Count

Gets the number of annotations in this collection.

public int Count { get; }

Property Value

Int32

Item

public PdfAnnotation Item { get; }

Property Value

PdfAnnotation

Elements

Gets the collection containing the elements of this object.

public ArrayElements Elements { get; }

Property Value

ArrayElements

Owner

Gets the PdfDocument this object belongs to.

public PdfDocument Owner { get; }

Property Value

PdfDocument

IsIndirect

Indicates whether the object is an indirect object.

public bool IsIndirect { get; }

Property Value

Boolean

Internals

Gets the PdfInternals object of this document, that grants access to some internal structures which are not part of the public interface of PdfDocument.

public PdfObjectInternals Internals { get; }

Property Value

PdfObjectInternals

Reference

Gets the indirect reference of this object. If the value is null, this object is a direct object.

public PdfReference Reference { get; internal set; }

Property Value

PdfReference

ReferenceNotNull

Gets the indirect reference of this object. Throws if it is null.

public PdfReference ReferenceNotNull { get; }

Property Value

PdfReference

Exceptions

InvalidOperationException
The indirect reference must be not null here.

Methods

Add(PdfAnnotation)

Adds the specified annotation.

public void Add(PdfAnnotation annotation)

Parameters

annotation PdfAnnotation
The annotation.

Remove(PdfAnnotation)

Removes an annotation from the document.

public void Remove(PdfAnnotation annotation)

Parameters

annotation PdfAnnotation

Clear()

Removes all the annotations from the current page.

public void Clear()

FixImportedAnnotation(PdfPage)

Fixes the /P element in imported annotation.

internal static void FixImportedAnnotation(PdfPage page)

Parameters

page PdfPage

GetEnumerator()

Returns an enumerator that iterates through a collection.

public IEnumerator<PdfItem> GetEnumerator()

Returns

IEnumerator<PdfItem>