API Reference

Class

PdfTextRun

Namespace OfficeIMO.Pdf
Assembly OfficeIMO.Pdf
Modifiers sealed

Inline text segment with basic styling.

Inheritance

  • Object
  • PdfTextRun

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

PdfTextRun 4 overloads
public PdfTextRun(String text, Boolean bold, Boolean underline, Nullable<PdfColor> color, Boolean italic, Boolean strike, Nullable<Double> fontSize, Nullable<PdfStandardFont> font, String linkUri, String linkContents, PdfTextBaseline baseline, String linkDestinationName, PdfTabLeaderStyle tabLeader, Nullable<PdfColor> backgroundColor, String fontFamily) #

Create a new run with the specified styles.

Parameters

text System.String requiredposition: 0
Run text.
bold System.Boolean requiredposition: 1
Whether to render bold.
underline System.Boolean requiredposition: 2
Whether to underline.
color System.Nullable{OfficeIMO.Pdf.PdfColor} requiredposition: 3
Run color or null to use defaults.
italic System.Boolean requiredposition: 4
Whether to render italic.
strike System.Boolean requiredposition: 5
Whether to render strikethrough.
fontSize System.Nullable{System.Double} requiredposition: 6
Optional run font size in points.
font System.Nullable{OfficeIMO.Pdf.PdfStandardFont} requiredposition: 7
Optional standard PDF font for this run.
linkUri System.String requiredposition: 8
Optional absolute URI or catalog-base-relative URI for link annotation.
linkContents System.String requiredposition: 9
Optional link annotation contents; defaults to the run text when omitted.
baseline OfficeIMO.Pdf.PdfTextBaseline requiredposition: 10
Baseline placement for this run.
linkDestinationName System.String requiredposition: 11
Optional named destination for an internal document link annotation.
tabLeader OfficeIMO.Pdf.PdfTabLeaderStyle requiredposition: 12
Leader fill to render when the run text is a tab character.
backgroundColor System.Nullable{OfficeIMO.Pdf.PdfColor} requiredposition: 13
Optional run background color.
fontFamily System.String requiredposition: 14
Optional registered embedded family name. font is used as its fallback.
public PdfTextRun(String text, Boolean bold, Boolean underline, Nullable<PdfColor> color, Boolean italic, Boolean strike, Nullable<Double> fontSize, Nullable<PdfStandardFont> font, String linkUri, String linkContents, PdfTextBaseline baseline, String linkDestinationName, PdfTabLeaderStyle tabLeader, PdfTabAlignment tabAlignment, Nullable<PdfColor> backgroundColor, String fontFamily) #

Create a run using the pre-typography constructor signature with tab alignment.

Parameters

text System.String requiredposition: 0
bold System.Boolean requiredposition: 1
underline System.Boolean requiredposition: 2
color System.Nullable{OfficeIMO.Pdf.PdfColor} requiredposition: 3
italic System.Boolean requiredposition: 4
strike System.Boolean requiredposition: 5
fontSize System.Nullable{System.Double} requiredposition: 6
font System.Nullable{OfficeIMO.Pdf.PdfStandardFont} requiredposition: 7
linkUri System.String requiredposition: 8
linkContents System.String requiredposition: 9
baseline OfficeIMO.Pdf.PdfTextBaseline requiredposition: 10
linkDestinationName System.String requiredposition: 11
tabLeader OfficeIMO.Pdf.PdfTabLeaderStyle requiredposition: 12
tabAlignment OfficeIMO.Pdf.PdfTabAlignment requiredposition: 13
backgroundColor System.Nullable{OfficeIMO.Pdf.PdfColor} requiredposition: 14
fontFamily System.String requiredposition: 15
public PdfTextRun(String text, Boolean bold, Boolean underline, Nullable<PdfColor> color, Boolean italic, Boolean strike, Nullable<Double> fontSize, Nullable<PdfStandardFont> font, String linkUri, String linkContents, PdfTextBaseline baseline, String linkDestinationName, PdfTabLeaderStyle tabLeader, PdfTabAlignment tabAlignment, Nullable<PdfColor> backgroundColor, String fontFamily, OfficeTextDecorationStyle underlineStyle, OfficeTextDecorationStyle strikeStyle) #

Create a run with typography styles and the inherited text decoration color.

Parameters

text System.String requiredposition: 0
bold System.Boolean requiredposition: 1
underline System.Boolean requiredposition: 2
color System.Nullable{OfficeIMO.Pdf.PdfColor} requiredposition: 3
italic System.Boolean requiredposition: 4
strike System.Boolean requiredposition: 5
fontSize System.Nullable{System.Double} requiredposition: 6
font System.Nullable{OfficeIMO.Pdf.PdfStandardFont} requiredposition: 7
linkUri System.String requiredposition: 8
linkContents System.String requiredposition: 9
baseline OfficeIMO.Pdf.PdfTextBaseline requiredposition: 10
linkDestinationName System.String requiredposition: 11
tabLeader OfficeIMO.Pdf.PdfTabLeaderStyle requiredposition: 12
tabAlignment OfficeIMO.Pdf.PdfTabAlignment requiredposition: 13
backgroundColor System.Nullable{OfficeIMO.Pdf.PdfColor} requiredposition: 14
fontFamily System.String requiredposition: 15
underlineStyle OfficeIMO.Drawing.OfficeTextDecorationStyle requiredposition: 16
strikeStyle OfficeIMO.Drawing.OfficeTextDecorationStyle requiredposition: 17
public PdfTextRun(String text, Boolean bold = false, Boolean underline = false, Nullable<PdfColor> color = null, Boolean italic = false, Boolean strike = false, Nullable<Double> fontSize = null, Nullable<PdfStandardFont> font = null, String linkUri = null, String linkContents = null, PdfTextBaseline baseline = Normal, String linkDestinationName = null, PdfTabLeaderStyle tabLeader = None, PdfTabAlignment tabAlignment = Left, Nullable<PdfColor> backgroundColor = null, String fontFamily = null, OfficeTextDecorationStyle underlineStyle = None, OfficeTextDecorationStyle strikeStyle = None, Nullable<PdfColor> decorationColor = null) #

Create a new run with the specified styles and tab alignment.

Parameters

text System.String requiredposition: 0
bold System.Boolean = false optionalposition: 1
underline System.Boolean = false optionalposition: 2
color System.Nullable{OfficeIMO.Pdf.PdfColor} = null optionalposition: 3
italic System.Boolean = false optionalposition: 4
strike System.Boolean = false optionalposition: 5
fontSize System.Nullable{System.Double} = null optionalposition: 6
font System.Nullable{OfficeIMO.Pdf.PdfStandardFont} = null optionalposition: 7
linkUri System.String = null optionalposition: 8
linkContents System.String = null optionalposition: 9
baseline OfficeIMO.Pdf.PdfTextBaseline = Normal optionalposition: 10
linkDestinationName System.String = null optionalposition: 11
tabLeader OfficeIMO.Pdf.PdfTabLeaderStyle = None optionalposition: 12
tabAlignment OfficeIMO.Pdf.PdfTabAlignment = Left optionalposition: 13
backgroundColor System.Nullable{OfficeIMO.Pdf.PdfColor} = null optionalposition: 14
fontFamily System.String = null optionalposition: 15
underlineStyle OfficeIMO.Drawing.OfficeTextDecorationStyle = None optionalposition: 16
strikeStyle OfficeIMO.Drawing.OfficeTextDecorationStyle = None optionalposition: 17
decorationColor System.Nullable{OfficeIMO.Pdf.PdfColor} = null optionalposition: 18

Methods

public static PdfTextRun Bolded(String text, Nullable<PdfColor> color = null, Nullable<Double> fontSize = null, Nullable<PdfColor> backgroundColor = null, Nullable<PdfStandardFont> font = null, String fontFamily = null) #
Returns: PdfTextRun

Create a bold run.

Parameters

text System.String requiredposition: 0
color System.Nullable{OfficeIMO.Pdf.PdfColor} = null optionalposition: 1
fontSize System.Nullable{System.Double} = null optionalposition: 2
backgroundColor System.Nullable{OfficeIMO.Pdf.PdfColor} = null optionalposition: 3
font System.Nullable{OfficeIMO.Pdf.PdfStandardFont} = null optionalposition: 4
fontFamily System.String = null optionalposition: 5
public static PdfTextRun BoldItalic(String text, Nullable<PdfColor> color = null, Nullable<Double> fontSize = null, Nullable<PdfColor> backgroundColor = null, Nullable<PdfStandardFont> font = null, String fontFamily = null) #
Returns: PdfTextRun

Create a bold and italic run.

Parameters

text System.String requiredposition: 0
color System.Nullable{OfficeIMO.Pdf.PdfColor} = null optionalposition: 1
fontSize System.Nullable{System.Double} = null optionalposition: 2
backgroundColor System.Nullable{OfficeIMO.Pdf.PdfColor} = null optionalposition: 3
font System.Nullable{OfficeIMO.Pdf.PdfStandardFont} = null optionalposition: 4
fontFamily System.String = null optionalposition: 5
public static PdfTextRun BoldUnderlined(String text, Nullable<PdfColor> color = null, Nullable<Double> fontSize = null, Nullable<PdfColor> backgroundColor = null, Nullable<PdfStandardFont> font = null, String fontFamily = null) #
Returns: PdfTextRun

Create a bold and underlined run.

Parameters

text System.String requiredposition: 0
color System.Nullable{OfficeIMO.Pdf.PdfColor} = null optionalposition: 1
fontSize System.Nullable{System.Double} = null optionalposition: 2
backgroundColor System.Nullable{OfficeIMO.Pdf.PdfColor} = null optionalposition: 3
font System.Nullable{OfficeIMO.Pdf.PdfStandardFont} = null optionalposition: 4
fontFamily System.String = null optionalposition: 5
public static PdfTextRun Inline(PdfInlineElement element) #
Returns: PdfTextRun

Create a fixed-size inline visual run.

Parameters

element OfficeIMO.Pdf.PdfInlineElement requiredposition: 0
public static PdfTextRun Italicized(String text, Nullable<PdfColor> color = null, Nullable<Double> fontSize = null, Nullable<PdfColor> backgroundColor = null, Nullable<PdfStandardFont> font = null, String fontFamily = null) #
Returns: PdfTextRun

Create an italic run.

Parameters

text System.String requiredposition: 0
color System.Nullable{OfficeIMO.Pdf.PdfColor} = null optionalposition: 1
fontSize System.Nullable{System.Double} = null optionalposition: 2
backgroundColor System.Nullable{OfficeIMO.Pdf.PdfColor} = null optionalposition: 3
font System.Nullable{OfficeIMO.Pdf.PdfStandardFont} = null optionalposition: 4
fontFamily System.String = null optionalposition: 5
public static PdfTextRun LineBreak() #
Returns: PdfTextRun

Create an explicit line-break run.

Link 2 overloads
LinkToBookmark 2 overloads
public static PdfTextRun LinkToBookmark(String text, String bookmarkName, Nullable<PdfColor> color, Boolean underline, String contents, PdfTextBaseline baseline, Nullable<Double> fontSize, Nullable<PdfColor> backgroundColor, Nullable<PdfStandardFont> font, String fontFamily) #
Returns: PdfTextRun

Create a hyperlink run that points to a document bookmark.

Parameters

text System.String requiredposition: 0
bookmarkName System.String requiredposition: 1
color System.Nullable{OfficeIMO.Pdf.PdfColor} requiredposition: 2
underline System.Boolean requiredposition: 3
contents System.String requiredposition: 4
baseline OfficeIMO.Pdf.PdfTextBaseline requiredposition: 5
fontSize System.Nullable{System.Double} requiredposition: 6
backgroundColor System.Nullable{OfficeIMO.Pdf.PdfColor} requiredposition: 7
font System.Nullable{OfficeIMO.Pdf.PdfStandardFont} requiredposition: 8
fontFamily System.String requiredposition: 9
public static PdfTextRun LinkToBookmark(String text, String bookmarkName, Nullable<PdfColor> color = null, Boolean underline = true, String contents = null, PdfTextBaseline baseline = Normal, Nullable<Double> fontSize = null, Nullable<PdfColor> backgroundColor = null, Nullable<PdfStandardFont> font = null, String fontFamily = null, OfficeTextDecorationStyle underlineStyle = None, OfficeTextDecorationStyle strikeStyle = None) #
Returns: PdfTextRun

Create a hyperlink run that points to a document bookmark with native decoration styles.

Parameters

text System.String requiredposition: 0
Link text.
bookmarkName System.String requiredposition: 1
Named destination created with String).
color System.Nullable{OfficeIMO.Pdf.PdfColor} = null optionalposition: 2
Optional link color.
underline System.Boolean = true optionalposition: 3
Whether to underline the link text.
contents System.String = null optionalposition: 4
Optional link annotation contents.
baseline OfficeIMO.Pdf.PdfTextBaseline = Normal optionalposition: 5
Baseline placement for this run.
fontSize System.Nullable{System.Double} = null optionalposition: 6
Optional run font size in points.
backgroundColor System.Nullable{OfficeIMO.Pdf.PdfColor} = null optionalposition: 7
Optional run background color.
font System.Nullable{OfficeIMO.Pdf.PdfStandardFont} = null optionalposition: 8
Optional standard font family for this run.
fontFamily System.String = null optionalposition: 9
Optional registered embedded family name. font remains its fallback.
underlineStyle OfficeIMO.Drawing.OfficeTextDecorationStyle = None optionalposition: 10
Optional underline pattern.
strikeStyle OfficeIMO.Drawing.OfficeTextDecorationStyle = None optionalposition: 11
Optional strikethrough pattern.
public static PdfTextRun Normal(String text, Nullable<PdfColor> color = null, Nullable<Double> fontSize = null, Nullable<PdfColor> backgroundColor = null, Nullable<PdfStandardFont> font = null, String fontFamily = null) #
Returns: PdfTextRun

Create a normal (unstyled) run.

Parameters

text System.String requiredposition: 0
color System.Nullable{OfficeIMO.Pdf.PdfColor} = null optionalposition: 1
fontSize System.Nullable{System.Double} = null optionalposition: 2
backgroundColor System.Nullable{OfficeIMO.Pdf.PdfColor} = null optionalposition: 3
font System.Nullable{OfficeIMO.Pdf.PdfStandardFont} = null optionalposition: 4
fontFamily System.String = null optionalposition: 5
public static PdfTextRun Strikethrough(String text, Nullable<PdfColor> color = null, Nullable<Double> fontSize = null, Nullable<PdfColor> backgroundColor = null, Nullable<PdfStandardFont> font = null, String fontFamily = null) #
Returns: PdfTextRun

Create a strikethrough run.

Parameters

text System.String requiredposition: 0
color System.Nullable{OfficeIMO.Pdf.PdfColor} = null optionalposition: 1
fontSize System.Nullable{System.Double} = null optionalposition: 2
backgroundColor System.Nullable{OfficeIMO.Pdf.PdfColor} = null optionalposition: 3
font System.Nullable{OfficeIMO.Pdf.PdfStandardFont} = null optionalposition: 4
fontFamily System.String = null optionalposition: 5
public static PdfTextRun Subscript(String text, Nullable<PdfColor> color = null, Nullable<Double> fontSize = null, Nullable<PdfColor> backgroundColor = null, Nullable<PdfStandardFont> font = null, String fontFamily = null) #
Returns: PdfTextRun

Create a subscript run.

Parameters

text System.String requiredposition: 0
color System.Nullable{OfficeIMO.Pdf.PdfColor} = null optionalposition: 1
fontSize System.Nullable{System.Double} = null optionalposition: 2
backgroundColor System.Nullable{OfficeIMO.Pdf.PdfColor} = null optionalposition: 3
font System.Nullable{OfficeIMO.Pdf.PdfStandardFont} = null optionalposition: 4
fontFamily System.String = null optionalposition: 5
public static PdfTextRun Superscript(String text, Nullable<PdfColor> color = null, Nullable<Double> fontSize = null, Nullable<PdfColor> backgroundColor = null, Nullable<PdfStandardFont> font = null, String fontFamily = null) #
Returns: PdfTextRun

Create a superscript run.

Parameters

text System.String requiredposition: 0
color System.Nullable{OfficeIMO.Pdf.PdfColor} = null optionalposition: 1
fontSize System.Nullable{System.Double} = null optionalposition: 2
backgroundColor System.Nullable{OfficeIMO.Pdf.PdfColor} = null optionalposition: 3
font System.Nullable{OfficeIMO.Pdf.PdfStandardFont} = null optionalposition: 4
fontFamily System.String = null optionalposition: 5
Tab 2 overloads
public static PdfTextRun Tab(PdfTabLeaderStyle leader) #
Returns: PdfTextRun

Create an explicit paragraph tab run.

Parameters

leader OfficeIMO.Pdf.PdfTabLeaderStyle requiredposition: 0
public static PdfTextRun Tab(PdfTabLeaderStyle leader = None, PdfTabAlignment alignment = Left) #
Returns: PdfTextRun

Create an explicit paragraph tab run with alignment.

Parameters

leader OfficeIMO.Pdf.PdfTabLeaderStyle = None optionalposition: 0
alignment OfficeIMO.Pdf.PdfTabAlignment = Left optionalposition: 1
public static PdfTextRun Underlined(String text, Nullable<PdfColor> color = null, Nullable<Double> fontSize = null, Nullable<PdfColor> backgroundColor = null, Nullable<PdfStandardFont> font = null, String fontFamily = null) #
Returns: PdfTextRun

Create an underlined run.

Parameters

text System.String requiredposition: 0
color System.Nullable{OfficeIMO.Pdf.PdfColor} = null optionalposition: 1
fontSize System.Nullable{System.Double} = null optionalposition: 2
backgroundColor System.Nullable{OfficeIMO.Pdf.PdfColor} = null optionalposition: 3
font System.Nullable{OfficeIMO.Pdf.PdfStandardFont} = null optionalposition: 4
fontFamily System.String = null optionalposition: 5
public PdfTextRun WithFeatureSettings(OfficeTextFeatureSettings featureSettings) #
Returns: PdfTextRun

Creates a copy with explicit OpenType feature selections.

Parameters

featureSettings OfficeIMO.Drawing.OfficeTextFeatureSettings requiredposition: 0
public PdfTextRun WithTextCase(OfficeTextCase textCase, CultureInfo culture = null) #
Returns: PdfTextRun

Create a copy with transformed text casing while preserving all run formatting and link metadata.

Parameters

textCase OfficeIMO.Drawing.OfficeTextCase requiredposition: 0
culture System.Globalization.CultureInfo = null optionalposition: 1

Properties

public String Text { get; } #

Text content of this run.

public Boolean Bold { get; } #

True when bold style is applied.

public Boolean Underline { get; } #

True when underline is applied.

public OfficeTextDecorationStyle UnderlineStyle { get; } #

Underline pattern rendered by the PDF writer.

public Boolean Strike { get; } #

True when strikethrough is applied.

public OfficeTextDecorationStyle StrikeStyle { get; } #

Strikethrough pattern rendered by the PDF writer.

public Nullable<PdfColor> DecorationColor { get; } #

Optional underline and strikethrough color. Null uses the run foreground color.

public Boolean Italic { get; } #

True when italic style is applied.

public Nullable<PdfColor> Color { get; } #

Run foreground color (if any).

public Nullable<PdfColor> BackgroundColor { get; } #

Optional run background color, useful for highlights.

public Nullable<Double> FontSize { get; } #

Optional font size for this run. When null, the paragraph font size is used.

public Nullable<PdfStandardFont> Font { get; } #

Optional standard PDF font for this run. When null, the paragraph/document font is used.

public String FontFamily { get; } #

Optional registered embedded font family for this run. This does not consume a standard-font compatibility slot; Font remains the fallback when the family is unavailable.

public String LinkUri { get; } #

Optional hyperlink URI associated with this run.

public String LinkDestinationName { get; } #

Optional named destination associated with this run.

public String LinkContents { get; } #

Optional hyperlink annotation contents, used by readers as link metadata.

public PdfTextBaseline Baseline { get; } #

Baseline placement for this run.

public PdfTabLeaderStyle TabLeader { get; } #

Leader fill used when this run represents a paragraph tab.

public PdfTabAlignment TabAlignment { get; } #

Alignment used when this run represents a paragraph tab.

public PdfInlineElement InlineElement { get; } #

Optional fixed-size visual carried by this run instead of text.

public OfficeTextFeatureSettings FeatureSettings { get; set; } #

Optional OpenType feature selections for this run.