API Reference
PdfTextRun
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.
Returned or exposed by
- Property FooterSegment.StyledRun
- Method PdfEmbeddedFontFallbackSet.PlanTextRuns
- Method PdfEmbeddedFontFallbackSet.PlanTextRuns
- Property PdfKeyValueRow.KeyRuns
- Property PdfKeyValueRow.ValueRuns
- Property PdfListItem.Runs
- Property PdfTableCell.Runs
- Method PdfTextFallbackPlan.ToNamedTextRuns
- Method PdfTextFallbackPlan.ToTextRuns
- Method PdfTextFallbackPlan.ToTextRuns
- Method PdfTextRun.Bolded
- Method PdfTextRun.BoldItalic
- Method PdfTextRun.BoldUnderlined
- Method PdfTextRun.Inline
- Method PdfTextRun.Italicized
- Method PdfTextRun.LineBreak
- Method PdfTextRun.Link
- Method PdfTextRun.Link
- Method PdfTextRun.LinkToBookmark
- Method PdfTextRun.LinkToBookmark
- Method PdfTextRun.Normal
- Method PdfTextRun.Strikethrough
- Method PdfTextRun.Subscript
- Method PdfTextRun.Superscript
- Method PdfTextRun.Tab
- Method PdfTextRun.Tab
- Method PdfTextRun.Underlined
- Method PdfTextRun.WithFeatureSettings
- Method PdfTextRun.WithTextCase
Accepted by parameters
- Method FooterSegment.PageNumber
- Method FooterSegment.RichText
- Method FooterSegment.TotalPages
- Method FooterTextBuilder.CurrentPage
- Method FooterTextBuilder.Run
- Method FooterTextBuilder.TotalPages
- Method HeaderTextBuilder.CurrentPage
- Method HeaderTextBuilder.Run
- Method HeaderTextBuilder.TotalPages
- Method PdfEmbeddedFontFallbackSet.PlanTextRuns
- Method PdfEmbeddedFontFallbackSet.PlanTextRuns
- Method PdfEmbeddedFontFallbackSet.TryPlanTextRuns
- Method PdfEmbeddedFontFallbackSet.TryPlanTextRuns
- Method PdfEmbeddedFontFallbackSet.TryPlanTextRuns
- Method PdfEmbeddedFontFallbackSet.TryPlanTextRuns
- Constructor PdfKeyValueRow.PdfKeyValueRow
- Constructor PdfKeyValueRow.PdfKeyValueRow
- Method PdfKeyValueRow.Rich
- Method PdfKeyValueRow.Rich
- Constructor PdfListItem.PdfListItem
- Method PdfListItem.Rich
- Method PdfPageCanvas.Text
- Method PdfPageCanvas.Text
- Method PdfPageCanvas.TextBox
- Method PdfPageCanvas.TextBox
- Method PdfPageCanvas.TextBox
- Method PdfParagraphBuilder.Runs
- Constructor PdfTableCell.PdfTableCell
- Method PdfTableCell.Merge
- Method PdfTableCell.RichTextCell
- Method PdfTableCell.Span
- Method PdfTableCell.WithCheckBoxes
- Method PdfTableCell.WithFormFields
- Method PdfTableCell.WithImages
- Method PdfTextFallbackPlan.ToNamedTextRuns
- Method PdfTextFallbackPlan.ToTextRuns
- Method PdfTextFallbackPlan.ToTextRuns
Constructors
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
- Run text.
- bold System.Boolean
- Whether to render bold.
- underline System.Boolean
- Whether to underline.
- color System.Nullable{OfficeIMO.Pdf.PdfColor}
- Run color or null to use defaults.
- italic System.Boolean
- Whether to render italic.
- strike System.Boolean
- Whether to render strikethrough.
- fontSize System.Nullable{System.Double}
- Optional run font size in points.
- font System.Nullable{OfficeIMO.Pdf.PdfStandardFont}
- Optional standard PDF font for this run.
- linkUri System.String
- Optional absolute URI or catalog-base-relative URI for link annotation.
- linkContents System.String
- Optional link annotation contents; defaults to the run text when omitted.
- baseline OfficeIMO.Pdf.PdfTextBaseline
- Baseline placement for this run.
- linkDestinationName System.String
- Optional named destination for an internal document link annotation.
- tabLeader OfficeIMO.Pdf.PdfTabLeaderStyle
- Leader fill to render when the run text is a tab character.
- backgroundColor System.Nullable{OfficeIMO.Pdf.PdfColor}
- Optional run background color.
- fontFamily System.String
- 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
- bold System.Boolean
- underline System.Boolean
- color System.Nullable{OfficeIMO.Pdf.PdfColor}
- italic System.Boolean
- strike System.Boolean
- fontSize System.Nullable{System.Double}
- font System.Nullable{OfficeIMO.Pdf.PdfStandardFont}
- linkUri System.String
- linkContents System.String
- baseline OfficeIMO.Pdf.PdfTextBaseline
- linkDestinationName System.String
- tabLeader OfficeIMO.Pdf.PdfTabLeaderStyle
- tabAlignment OfficeIMO.Pdf.PdfTabAlignment
- backgroundColor System.Nullable{OfficeIMO.Pdf.PdfColor}
- fontFamily System.String
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
- bold System.Boolean
- underline System.Boolean
- color System.Nullable{OfficeIMO.Pdf.PdfColor}
- italic System.Boolean
- strike System.Boolean
- fontSize System.Nullable{System.Double}
- font System.Nullable{OfficeIMO.Pdf.PdfStandardFont}
- linkUri System.String
- linkContents System.String
- baseline OfficeIMO.Pdf.PdfTextBaseline
- linkDestinationName System.String
- tabLeader OfficeIMO.Pdf.PdfTabLeaderStyle
- tabAlignment OfficeIMO.Pdf.PdfTabAlignment
- backgroundColor System.Nullable{OfficeIMO.Pdf.PdfColor}
- fontFamily System.String
- underlineStyle OfficeIMO.Drawing.OfficeTextDecorationStyle
- strikeStyle OfficeIMO.Drawing.OfficeTextDecorationStyle
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
- bold System.Boolean = false
- underline System.Boolean = false
- color System.Nullable{OfficeIMO.Pdf.PdfColor} = null
- italic System.Boolean = false
- strike System.Boolean = false
- fontSize System.Nullable{System.Double} = null
- font System.Nullable{OfficeIMO.Pdf.PdfStandardFont} = null
- linkUri System.String = null
- linkContents System.String = null
- baseline OfficeIMO.Pdf.PdfTextBaseline = Normal
- linkDestinationName System.String = null
- tabLeader OfficeIMO.Pdf.PdfTabLeaderStyle = None
- tabAlignment OfficeIMO.Pdf.PdfTabAlignment = Left
- backgroundColor System.Nullable{OfficeIMO.Pdf.PdfColor} = null
- fontFamily System.String = null
- underlineStyle OfficeIMO.Drawing.OfficeTextDecorationStyle = None
- strikeStyle OfficeIMO.Drawing.OfficeTextDecorationStyle = None
- decorationColor System.Nullable{OfficeIMO.Pdf.PdfColor} = null
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) #PdfTextRunCreate a bold run.
Parameters
- text System.String
- color System.Nullable{OfficeIMO.Pdf.PdfColor} = null
- fontSize System.Nullable{System.Double} = null
- backgroundColor System.Nullable{OfficeIMO.Pdf.PdfColor} = null
- font System.Nullable{OfficeIMO.Pdf.PdfStandardFont} = null
- fontFamily System.String = null
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) #PdfTextRunCreate a bold and italic run.
Parameters
- text System.String
- color System.Nullable{OfficeIMO.Pdf.PdfColor} = null
- fontSize System.Nullable{System.Double} = null
- backgroundColor System.Nullable{OfficeIMO.Pdf.PdfColor} = null
- font System.Nullable{OfficeIMO.Pdf.PdfStandardFont} = null
- fontFamily System.String = null
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) #PdfTextRunCreate a bold and underlined run.
Parameters
- text System.String
- color System.Nullable{OfficeIMO.Pdf.PdfColor} = null
- fontSize System.Nullable{System.Double} = null
- backgroundColor System.Nullable{OfficeIMO.Pdf.PdfColor} = null
- font System.Nullable{OfficeIMO.Pdf.PdfStandardFont} = null
- fontFamily System.String = null
public static PdfTextRun Inline(PdfInlineElement element) #PdfTextRunCreate a fixed-size inline visual run.
Parameters
- element OfficeIMO.Pdf.PdfInlineElement
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) #PdfTextRunCreate an italic run.
Parameters
- text System.String
- color System.Nullable{OfficeIMO.Pdf.PdfColor} = null
- fontSize System.Nullable{System.Double} = null
- backgroundColor System.Nullable{OfficeIMO.Pdf.PdfColor} = null
- font System.Nullable{OfficeIMO.Pdf.PdfStandardFont} = null
- fontFamily System.String = null
public static PdfTextRun Link(String text, String uri, Nullable<PdfColor> color, Boolean underline, String contents, PdfTextBaseline baseline, Nullable<Double> fontSize, Nullable<PdfColor> backgroundColor, Nullable<PdfStandardFont> font, String fontFamily) #PdfTextRunCreate a hyperlink run that points to a URI.
Parameters
- text System.String
- uri System.String
- color System.Nullable{OfficeIMO.Pdf.PdfColor}
- underline System.Boolean
- contents System.String
- baseline OfficeIMO.Pdf.PdfTextBaseline
- fontSize System.Nullable{System.Double}
- backgroundColor System.Nullable{OfficeIMO.Pdf.PdfColor}
- font System.Nullable{OfficeIMO.Pdf.PdfStandardFont}
- fontFamily System.String
public static PdfTextRun Link(String text, String uri, 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) #PdfTextRunCreate a hyperlink run with native decoration styles.
Parameters
- text System.String
- Link text.
- uri System.String
- Absolute URI or catalog-base-relative URI.
- color System.Nullable{OfficeIMO.Pdf.PdfColor} = null
- Optional link color.
- underline System.Boolean = true
- Whether to underline the link text.
- contents System.String = null
- Optional link annotation contents.
- baseline OfficeIMO.Pdf.PdfTextBaseline = Normal
- Baseline placement for this run.
- fontSize System.Nullable{System.Double} = null
- Optional run font size in points.
- backgroundColor System.Nullable{OfficeIMO.Pdf.PdfColor} = null
- Optional run background color.
- font System.Nullable{OfficeIMO.Pdf.PdfStandardFont} = null
- Optional standard font family for this run.
- fontFamily System.String = null
- Optional registered embedded family name. font remains its fallback.
- underlineStyle OfficeIMO.Drawing.OfficeTextDecorationStyle = None
- Optional underline pattern.
- strikeStyle OfficeIMO.Drawing.OfficeTextDecorationStyle = None
- Optional strikethrough pattern.
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) #PdfTextRunCreate a hyperlink run that points to a document bookmark.
Parameters
- text System.String
- bookmarkName System.String
- color System.Nullable{OfficeIMO.Pdf.PdfColor}
- underline System.Boolean
- contents System.String
- baseline OfficeIMO.Pdf.PdfTextBaseline
- fontSize System.Nullable{System.Double}
- backgroundColor System.Nullable{OfficeIMO.Pdf.PdfColor}
- font System.Nullable{OfficeIMO.Pdf.PdfStandardFont}
- fontFamily System.String
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) #PdfTextRunCreate a hyperlink run that points to a document bookmark with native decoration styles.
Parameters
- text System.String
- Link text.
- bookmarkName System.String
- Named destination created with String).
- color System.Nullable{OfficeIMO.Pdf.PdfColor} = null
- Optional link color.
- underline System.Boolean = true
- Whether to underline the link text.
- contents System.String = null
- Optional link annotation contents.
- baseline OfficeIMO.Pdf.PdfTextBaseline = Normal
- Baseline placement for this run.
- fontSize System.Nullable{System.Double} = null
- Optional run font size in points.
- backgroundColor System.Nullable{OfficeIMO.Pdf.PdfColor} = null
- Optional run background color.
- font System.Nullable{OfficeIMO.Pdf.PdfStandardFont} = null
- Optional standard font family for this run.
- fontFamily System.String = null
- Optional registered embedded family name. font remains its fallback.
- underlineStyle OfficeIMO.Drawing.OfficeTextDecorationStyle = None
- Optional underline pattern.
- strikeStyle OfficeIMO.Drawing.OfficeTextDecorationStyle = None
- 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) #PdfTextRunCreate a normal (unstyled) run.
Parameters
- text System.String
- color System.Nullable{OfficeIMO.Pdf.PdfColor} = null
- fontSize System.Nullable{System.Double} = null
- backgroundColor System.Nullable{OfficeIMO.Pdf.PdfColor} = null
- font System.Nullable{OfficeIMO.Pdf.PdfStandardFont} = null
- fontFamily System.String = null
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) #PdfTextRunCreate a strikethrough run.
Parameters
- text System.String
- color System.Nullable{OfficeIMO.Pdf.PdfColor} = null
- fontSize System.Nullable{System.Double} = null
- backgroundColor System.Nullable{OfficeIMO.Pdf.PdfColor} = null
- font System.Nullable{OfficeIMO.Pdf.PdfStandardFont} = null
- fontFamily System.String = null
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) #PdfTextRunCreate a subscript run.
Parameters
- text System.String
- color System.Nullable{OfficeIMO.Pdf.PdfColor} = null
- fontSize System.Nullable{System.Double} = null
- backgroundColor System.Nullable{OfficeIMO.Pdf.PdfColor} = null
- font System.Nullable{OfficeIMO.Pdf.PdfStandardFont} = null
- fontFamily System.String = null
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) #PdfTextRunCreate a superscript run.
Parameters
- text System.String
- color System.Nullable{OfficeIMO.Pdf.PdfColor} = null
- fontSize System.Nullable{System.Double} = null
- backgroundColor System.Nullable{OfficeIMO.Pdf.PdfColor} = null
- font System.Nullable{OfficeIMO.Pdf.PdfStandardFont} = null
- fontFamily System.String = null
public static PdfTextRun Tab(PdfTabLeaderStyle leader) #PdfTextRunCreate an explicit paragraph tab run.
Parameters
- leader OfficeIMO.Pdf.PdfTabLeaderStyle
public static PdfTextRun Tab(PdfTabLeaderStyle leader = None, PdfTabAlignment alignment = Left) #PdfTextRunCreate an explicit paragraph tab run with alignment.
Parameters
- leader OfficeIMO.Pdf.PdfTabLeaderStyle = None
- alignment OfficeIMO.Pdf.PdfTabAlignment = Left
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) #PdfTextRunCreate an underlined run.
Parameters
- text System.String
- color System.Nullable{OfficeIMO.Pdf.PdfColor} = null
- fontSize System.Nullable{System.Double} = null
- backgroundColor System.Nullable{OfficeIMO.Pdf.PdfColor} = null
- font System.Nullable{OfficeIMO.Pdf.PdfStandardFont} = null
- fontFamily System.String = null
public PdfTextRun WithFeatureSettings(OfficeTextFeatureSettings featureSettings) #PdfTextRunCreates a copy with explicit OpenType feature selections.
Parameters
- featureSettings OfficeIMO.Drawing.OfficeTextFeatureSettings
public PdfTextRun WithTextCase(OfficeTextCase textCase, CultureInfo culture = null) #PdfTextRunCreate a copy with transformed text casing while preserving all run formatting and link metadata.
Parameters
- textCase OfficeIMO.Drawing.OfficeTextCase
- culture System.Globalization.CultureInfo = null
Inherited Methods
Properties
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.