Class PdfTextRun
- Namespace
- PDiffy
- Assembly
- PDiffy.dll
Text on one line that shares a font, size, color, render mode and role. Positions are in points from the page's bottom-left corner.
public sealed record PdfTextRun : IEquatable<PdfTextRun>
- Inheritance
-
PdfTextRun
- Implements
- Inherited Members
Properties
Angle
The angle the text runs at, in degrees counterclockwise, such as 90 for text that reads upward; 0 for text across the page.
public int Angle { get; init; }
Property Value
BlendMode
How its colors mix with what's drawn under it; Normal paints over it.
public PdfBlendMode BlendMode { get; init; }
Property Value
Clipped
Whether the clipping area (a clipping path, or the box of a form it's drawn in) leaves it out entirely, so it doesn't show. Content the clipping area cuts only partly isn't marked. A clipping path counts in its real shape, with curves traced in small straight steps. Text drawn in a clipping mode (4 to 7) clips to its letters' shapes, or to their boxes when PDiffy can't read the font's outlines, as with a standard font that isn't embedded.
public bool Clipped { get; init; }
Property Value
Color
The text's color, written like "gray:0", "#ff0000", "cmyk:0,0,0,1" or, for a gradient or tiled fill, its kind and a hash of what it draws ("pattern:shading:3f9c0a1b2d4e5f60"), plus, for an uncolored tile, the color it's painted in ("pattern:tiling:3f9c0a1b2d4e5f60:#ff0000"); null when the PDF library can't tell. A color given in a color space other than a device or pattern one, such as a spot color or an ICC-based one, starts with that space's family and a hash of its definition ("separation:3f9c0a1b2d4e5f60:cmyk:0,0.81,1,0").
public required string? Color { get; init; }
Property Value
Covered
Whether something opaque drawn after it covers all of it, so it doesn't show. Only a shape filled with a plain color or an image without a mask counts as covering, and not when it's in a layer. It covers only what lies wholly inside its real shape. Content covered only partly isn't marked.
public bool Covered { get; init; }
Property Value
Font
The font's name without a subset prefix, such as "Helvetica-Bold" for "ABCDEF+Helvetica-Bold"; "(none)" when the PDF doesn't name it.
public required string Font { get; init; }
Property Value
GroupBlendModes
The blend modes of the transparency groups it's drawn in that BlendMode leaves out because it already holds a mode set inside the group, innermost first. Each mixes its group as a whole with what's under it. Empty when there are none.
public IReadOnlyList<PdfBlendMode> GroupBlendModes { get; init; }
Property Value
Layers
The optional-content layers the text is drawn in, outermost first, by name, such as "Draft"; empty when it's drawn outside optional content. A viewer can hide a layer, so its content may not show or print.
public IReadOnlyList<string> Layers { get; init; }
Property Value
Opacity
How opaque its fill is, from 0 (invisible) to 1, rounded to two decimal places; 1 when it isn't filled or no graphics state makes it see-through.
public double Opacity { get; init; }
Property Value
Page
The page number, counted from 1.
public required int Page { get; init; }
Property Value
RenderMode
How the text is drawn: filled, outlined, invisible or used as a clip.
public required PdfTextRenderMode RenderMode { get; init; }
Property Value
RenderingIntent
How colors outside what the output device can show are brought into what it can (the ri operator, or /RI in a graphics state); RelativeColorimetric, PDF's default, unless set.
public PdfRenderingIntent RenderingIntent { get; init; }
Property Value
Role
Whether the text is tagged, an artifact, or untagged.
public required PdfContentRole Role { get; init; }
Property Value
Size
The size the text is drawn at, in points, rounded to one decimal place, such as 11.5.
public required double Size { get; init; }
Property Value
SoftMask
A hash of the soft masks that make parts of it see-through, as a gradient fade does, including what they draw, such as "3f9c0a1b2d4e5f60", or "unreadable"; null when it has no soft mask.
public string? SoftMask { get; init; }
Property Value
StrokeColor
The outline's color, written the same way as Color, when the text is both filled and outlined; null otherwise. Text that's only outlined has its outline's color in Color.
public string? StrokeColor { get; init; }
Property Value
StrokeOpacity
How opaque its outline is, from 0 (invisible) to 1, rounded to two decimal places; 1 when it isn't outlined or no graphics state makes it see-through.
public double StrokeOpacity { get; init; }
Property Value
Text
The run's text, with a space wherever the gap between letters is wide enough for one, any run of spaces, tabs or line breaks collapsed to one space, and no space at either end.
public required string Text { get; init; }
Property Value
Width
How long the run is along its baseline, from the start of its first letter to the end of its last, in points. Character and word spacing and horizontal scaling all change it.
public double Width { get; init; }
Property Value
X
How far across the page the run's first letter starts, on its baseline.
public required double X { get; init; }
Property Value
Y
How far up the page the run's baseline is, at its first letter.
public required double Y { get; init; }