Table of Contents

Class PdfAnnotation

Namespace
PDiffy
Assembly
PDiffy.dll

An annotation: a link, comment, form widget and so on. Its rectangle is in points from the page's bottom-left corner. Role is Tagged when a structure element points to it.

public sealed record PdfAnnotation : IEquatable<PdfAnnotation>
Inheritance
PdfAnnotation
Implements
Inherited Members

Properties

AccessibleName

A form widget's tooltip, which a screen reader announces as its name; null when it has none.

public string? AccessibleName { get; init; }

Property Value

string

Action

The type of action it runs, such as "GoTo", "Launch" or "JavaScript"; null when it has no action or its action opens a web address (Uri), and "URI" for a web-address action that names no address. PdfActionTypes lists the standard ones.

public string? Action { get; init; }

Property Value

string

ActionTarget

What its action acts on that Action doesn't say: a Named action's name; the fields a ResetForm or Hide action names, joined with commas, each a full name (or for a Hide, another annotation's /NM, or its type in parentheses), after "except:" when a ResetForm resets every field but those or "show:" when a Hide shows them; or the first 16 hex digits of a JavaScript action's script hash. "(unnamed)" for a field without a name, "(unknown)" for a reference to nothing and "(none)" for an empty list. Null otherwise.

public string? ActionTarget { get; init; }

Property Value

string

Appearance

A hash of the content of the annotation's normal appearance stream (/AP /N), including every state of a check box or radio button hashed together, or "unreadable"; null when it has no appearance. Form XObjects and fonts the stream uses aren't hashed.

public string? Appearance { get; init; }

Property Value

string

BackgroundColor

A widget's background color (/MK /BG); null when it sets none.

public string? BackgroundColor { get; init; }

Property Value

string

Border

The border's style and width, from /BS or the older /Border array; null when the annotation sets neither.

public PdfBorder? Border { get; init; }

Property Value

PdfBorder

BorderColor

A widget's border color (/MK /BC); null when it sets none.

public string? BorderColor { get; init; }

Property Value

string

Caption

A widget's caption (/MK /CA), such as a check box's symbol or a button's label; null when it has none.

public string? Caption { get; init; }

Property Value

string

Color

The annotation's color (/C), used for a link's border or a comment's icon, such as "#0000ff", or "none" for transparent; null when it sets none.

public string? Color { get; init; }

Property Value

string

Contents

The annotation's text, which for a link is its description for assistive technology; null when it has none.

public string? Contents { get; init; }

Property Value

string

Destination

Where the link goes, from its own destination or a GoTo, GoToR or GoToE action.

public PdfDestination? Destination { get; init; }

Property Value

PdfDestination

File

The file a GoToR or Launch action opens, or the address a SubmitForm action sends the form to. For GoToE, the embedded file it opens, as a path such as data.pdf/inner.pdf.

public string? File { get; init; }

Property Value

string

Flags

How a viewer treats it: whether it is shown, printed, editable and so on.

public PdfAnnotationFlags Flags { get; init; }

Property Value

PdfAnnotationFlags

Height

The rectangle's height in points.

public double Height { get; init; }

Property Value

double

Highlight

How a link or widget looks while it's clicked (/H): "none", "invert", "outline", "push" or "toggle"; null when it doesn't say, which means invert.

public string? Highlight { get; init; }

Property Value

string

MediaClips

The media clips a Screen annotation's Rendition actions play, on click or on an event such as the page opening, with every alternative a selector rendition offers; empty when it plays none.

public IReadOnlyList<PdfMediaClip> MediaClips { get; init; }

Property Value

IReadOnlyList<PdfMediaClip>

Page

The page it's on, counted from 1; null only when a structure element points to it and neither the annotation nor the element names a page.

public int? Page { get; init; }

Property Value

int?

Role

Tagged when a structure element points to it, otherwise Untagged.

public PdfContentRole Role { get; init; }

Property Value

PdfContentRole

Subtype

The kind of annotation, such as "Link", "Widget" or "Text"; "(none)" (None) when the PDF doesn't say. PdfAnnotationTypes lists the standard ones.

public required string Subtype { get; init; }

Property Value

string

Uri

The web address it opens; null when it opens none.

public string? Uri { get; init; }

Property Value

string

Width

The rectangle's width in points.

public double Width { get; init; }

Property Value

double

X

The rectangle's left edge, in points from the page's left edge.

public double X { get; init; }

Property Value

double

Y

The rectangle's bottom edge, in points from the page's bottom edge.

public double Y { get; init; }

Property Value

double