API Reference

Class

PdfTextSpan

Namespace OfficeIMO.Pdf
Assembly OfficeIMO.Pdf
Modifiers sealed

A piece of text extracted from a PDF page with basic font and position info. Coordinates are in user space units (points) as emitted by content stream Tm/Td.

Inheritance

  • Object
  • PdfTextSpan

Usage

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Accepted by parameters

Constructors

PdfTextSpan 2 overloads
public PdfTextSpan(String text, String fontResource, Double fontSize, Double x, Double y, Double advance = 0, Nullable<OfficeColor> color = null, Boolean isVisible = true, Double rotationDegrees = 0, String baseFont = null) #

Creates a new text span.

Parameters

text System.String requiredposition: 0
fontResource System.String requiredposition: 1
fontSize System.Double requiredposition: 2
x System.Double requiredposition: 3
y System.Double requiredposition: 4
advance System.Double = 0 optionalposition: 5
color System.Nullable{OfficeIMO.Drawing.OfficeColor} = null optionalposition: 6
isVisible System.Boolean = true optionalposition: 7
rotationDegrees System.Double = 0 optionalposition: 8
baseFont System.String = null optionalposition: 9
public PdfTextSpan(String text, String fontResource, Double fontSize, Double x, Double y, Double advance, Nullable<OfficeColor> color, Boolean isVisible, Double rotationDegrees, String baseFont, Nullable<Int32> fontWeight, Nullable<Int32> fontDescriptorFlags) #

Creates a new text span with explicit PDF font descriptor style evidence.

Parameters

text System.String requiredposition: 0
fontResource System.String requiredposition: 1
fontSize System.Double requiredposition: 2
x System.Double requiredposition: 3
y System.Double requiredposition: 4
advance System.Double requiredposition: 5
color System.Nullable{OfficeIMO.Drawing.OfficeColor} requiredposition: 6
isVisible System.Boolean requiredposition: 7
rotationDegrees System.Double requiredposition: 8
baseFont System.String requiredposition: 9
fontWeight System.Nullable{System.Int32} requiredposition: 10
fontDescriptorFlags System.Nullable{System.Int32} requiredposition: 11

Properties

public String Text { get; } #

Text content of the span.

public String FontResource { get; } #

Font resource name from the page resources (e.g., F1).

public String BaseFont { get; } #

PDF base font name resolved from the active resource dictionary, when available.

public Nullable<Int32> FontWeight { get; } #

Font descriptor weight from 1 through 1000, when declared by the PDF.

public Nullable<Int32> FontDescriptorFlags { get; } #

Raw PDF font descriptor flags, when declared by the PDF.

public Boolean IsBold { get; } #

True when declared weight or legacy font-name evidence identifies a bold face.

public Boolean IsItalic { get; } #

True when descriptor flags or legacy font-name evidence identifies an italic face.

public Double FontSize { get; } #

Font size in points.

public Double X { get; } #

X position (points) in page user space.

public Double Y { get; } #

Y position (points) in page user space.

public Double Advance { get; } #

Advance width in user space for this span (includes spacing and hscale).

public Nullable<OfficeColor> Color { get; } #

Fill color used for visual text rendering, when it could be read from the content stream.

public Boolean IsVisible { get; } #

True when the text span should be painted during visual rendering.

public Double RotationDegrees { get; } #

Baseline rotation in PDF user-space degrees, where positive angles are counter-clockwise.

public Nullable<Int32> MarkedContentId { get; } #

Active content-stream-scoped marked-content identifier from a tagged PDF, when present.

public Nullable<Int32> ContentStreamObjectNumber { get; } #

Form XObject or other content-stream object owning the MCID, or null for page content.

public Int32 TextRenderingMode { get; } #

PDF text rendering mode active for this span (0 through 7).

public Boolean IsArtifactContent { get; } #

True when this span came from PDF content explicitly marked as an /Artifact.