Class Annotation
A link or a destination for DrawAnnotation(RectF, Annotation): what a document backend writes, and pixels never show.
public sealed record Annotation : IEquatable<Annotation>
- Inheritance
-
Annotation
- Implements
- Inherited Members
Examples
// A layout engine marks links, destinations and structure while it draws; pixels show none of it.
canvas.BeginMarkedContent(new MarkedContent("P") { NodeId = 12 });
canvas.DrawAnnotation(new RectF(20, 130, 120, 16), Annotation.Url("https://example.com"));
canvas.DrawAnnotation(new RectF(20, 150, 0, 0), Annotation.NamedDestination("chapter-2"));
canvas.EndMarkedContent();
Constructors
Annotation(AnnotationKind, string)
A link or a destination for DrawAnnotation(RectF, Annotation): what a document backend writes, and pixels never show.
public Annotation(AnnotationKind Kind, string Value)
Parameters
KindAnnotationKindWhat the annotation marks.
ValuestringThe URL, or the destination's name.
Examples
// A layout engine marks links, destinations and structure while it draws; pixels show none of it.
canvas.BeginMarkedContent(new MarkedContent("P") { NodeId = 12 });
canvas.DrawAnnotation(new RectF(20, 130, 120, 16), Annotation.Url("https://example.com"));
canvas.DrawAnnotation(new RectF(20, 150, 0, 0), Annotation.NamedDestination("chapter-2"));
canvas.EndMarkedContent();
Properties
Kind
Gets what the annotation marks.
public AnnotationKind Kind { get; init; }
Property Value
Exceptions
- ArgumentOutOfRangeException
The value is not defined.
Value
Gets the URL, or the destination's name.
public string Value { get; init; }
Property Value
Exceptions
- ArgumentException
The value is empty.
Methods
LinkToDestination(string)
Returns a link to a named destination.
public static Annotation LinkToDestination(string name)
Parameters
namestringThe destination's name.
Returns
- Annotation
The annotation.
NamedDestination(string)
Returns a named destination.
public static Annotation NamedDestination(string name)
Parameters
namestringThe destination's name.
Returns
- Annotation
The annotation.
Url(string)
Returns a link to a URL.
public static Annotation Url(string url)
Parameters
urlstringThe URL.
Returns
- Annotation
The annotation.