Table of Contents

Class MarkedContent

Namespace
Egami.Drawing
Assembly
Egami.Drawing.dll

A tag that brackets a run of drawing for a document backend, as PDF's marked content (BMC, BDC and EMC): a structure element of tagged PDF (a paragraph, a heading, a figure), an artifact such as a page number, or a span with replacement text.

public sealed record MarkedContent : IEquatable<MarkedContent>
Inheritance
MarkedContent
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

MarkedContent(string)

A tag that brackets a run of drawing for a document backend, as PDF's marked content (BMC, BDC and EMC): a structure element of tagged PDF (a paragraph, a heading, a figure), an artifact such as a page number, or a span with replacement text.

public MarkedContent(string Tag)

Parameters

Tag string

The tag, such as P, H1, Figure, Span or Artifact: a PDF name without its slash.

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

ActualText

Gets the text the content stands for, PDF's ActualText (a ligature's letters, a drawn word), or null.

public string? ActualText { get; init; }

Property Value

string

AlternateText

Gets a description of the content for readers that cannot see it, PDF's Alt, or null.

public string? AlternateText { get; init; }

Property Value

string

NodeId

Gets the caller's id for the structure element this content belongs to, which a tagged-PDF backend maps to a marked-content id in its structure tree, as Skia's structure node ids; null for content outside the structure.

public int? NodeId { get; init; }

Property Value

int?

Tag

Gets the tag.

public string Tag { get; init; }

Property Value

string

Exceptions

ArgumentException

The tag is empty or holds a space, a slash or a control character.