API Reference

Class

PdfParagraphBuilder

Namespace OfficeIMO.Pdf
Assembly OfficeIMO.Pdf
Modifiers sealed

Fluent builder for rich paragraphs made of styled text runs.

Inheritance

  • Object
  • PdfParagraphBuilder

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

public PdfParagraphBuilder(PdfAlign align, Nullable<PdfColor> defaultColor) #

Create a new paragraph builder.

Parameters

align OfficeIMO.Pdf.PdfAlign requiredposition: 0
Paragraph alignment.
defaultColor System.Nullable{OfficeIMO.Pdf.PdfColor} requiredposition: 1
Optional default text color.

Methods

public PdfParagraphBuilder BackgroundColor(PdfColor color) #
Returns: PdfParagraphBuilder

Sets the current run background color.

Parameters

color OfficeIMO.Pdf.PdfColor requiredposition: 0
public PdfParagraphBuilder Baseline(PdfTextBaseline baseline) #
Returns: PdfParagraphBuilder

Sets the current baseline placement for subsequent runs.

Parameters

baseline OfficeIMO.Pdf.PdfTextBaseline requiredposition: 0
Bold 2 overloads
public PdfParagraphBuilder Bold(Boolean enable = true) #
Returns: PdfParagraphBuilder

Enables or disables bold for subsequent runs.

Parameters

enable System.Boolean = true optionalposition: 0
public PdfParagraphBuilder Bold(String text, Nullable<PdfColor> color = null) #
Returns: PdfParagraphBuilder

Adds a bold text run.

Parameters

text System.String requiredposition: 0
color System.Nullable{OfficeIMO.Pdf.PdfColor} = null optionalposition: 1
public PdfParagraphBuilder Color(PdfColor color) #
Returns: PdfParagraphBuilder

Sets the current run color.

Parameters

color OfficeIMO.Pdf.PdfColor requiredposition: 0
public PdfParagraphBuilder FallbackText(PdfEmbeddedFontFallbackSet fallbackSet, String text, String source = "") #
Returns: PdfParagraphBuilder

Adds text planned through an embedded-font fallback set while preserving the current run styling.

Parameters

fallbackSet OfficeIMO.Pdf.PdfEmbeddedFontFallbackSet requiredposition: 0
text System.String requiredposition: 1
source System.String = "" optionalposition: 2
public PdfParagraphBuilder Font(PdfStandardFont font) #
Returns: PdfParagraphBuilder

Sets the current standard PDF font for subsequent runs.

Parameters

font OfficeIMO.Pdf.PdfStandardFont requiredposition: 0
public PdfParagraphBuilder FontFamily(String familyName) #
Returns: PdfParagraphBuilder

Sets a registered embedded named family for subsequent runs.

Parameters

familyName System.String requiredposition: 0
public PdfParagraphBuilder FontSize(Double fontSize) #
Returns: PdfParagraphBuilder

Sets the current run font size in points.

Parameters

fontSize System.Double requiredposition: 0
public PdfParagraphBuilder Inline(PdfInlineElement element) #
Returns: PdfParagraphBuilder

Adds a fixed-size visual that participates in paragraph wrapping.

Parameters

element OfficeIMO.Pdf.PdfInlineElement requiredposition: 0
public PdfParagraphBuilder InlineBox(Double width, Double height, Nullable<PdfColor> background = null, Nullable<PdfColor> borderColor = null, Double borderWidth = 0.5, String alternativeText = null, Double baselineOffset = 0) #
Returns: PdfParagraphBuilder

Adds a filled and/or bordered box that participates in paragraph wrapping.

Parameters

width System.Double requiredposition: 0
height System.Double requiredposition: 1
background System.Nullable{OfficeIMO.Pdf.PdfColor} = null optionalposition: 2
borderColor System.Nullable{OfficeIMO.Pdf.PdfColor} = null optionalposition: 3
borderWidth System.Double = 0.5 optionalposition: 4
alternativeText System.String = null optionalposition: 5
baselineOffset System.Double = 0 optionalposition: 6
public PdfParagraphBuilder InlineImage(Byte[] imageBytes, Double width, Double height, String alternativeText = null, OfficeImageFit fit = Contain, Double baselineOffset = 0) #
Returns: PdfParagraphBuilder

Adds an image that participates in paragraph wrapping.

Parameters

imageBytes System.Byte[] requiredposition: 0
width System.Double requiredposition: 1
height System.Double requiredposition: 2
alternativeText System.String = null optionalposition: 3
fit OfficeIMO.Drawing.OfficeImageFit = Contain optionalposition: 4
baselineOffset System.Double = 0 optionalposition: 5
Italic 2 overloads
public PdfParagraphBuilder Italic(Boolean enable = true) #
Returns: PdfParagraphBuilder

Enables or disables italic for subsequent runs.

Parameters

enable System.Boolean = true optionalposition: 0
public PdfParagraphBuilder Italic(String text, Nullable<PdfColor> color = null) #
Returns: PdfParagraphBuilder

Adds an italic text run.

Parameters

text System.String requiredposition: 0
color System.Nullable{OfficeIMO.Pdf.PdfColor} = null optionalposition: 1
public PdfParagraphBuilder LineBreak() #
Returns: PdfParagraphBuilder

Adds an explicit line break inside the current paragraph.

public PdfParagraphBuilder LinkToBookmark(String text, String bookmarkName, Nullable<PdfColor> color = null, Boolean underline = true, String contents = null) #
Returns: PdfParagraphBuilder

Adds a hyperlink text run that points to a document bookmark.

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 (default true).
contents System.String = null optionalposition: 4
Optional link annotation contents; defaults to the link text when omitted.
public PdfParagraphBuilder ResetBackgroundColor() #
Returns: PdfParagraphBuilder

Resets the current run background color.

public PdfParagraphBuilder ResetColor() #
Returns: PdfParagraphBuilder

Resets the current run color to the paragraph default color.

public PdfParagraphBuilder ResetFont() #
Returns: PdfParagraphBuilder

Resets the current run font to the paragraph/document font.

public PdfParagraphBuilder ResetFontSize() #
Returns: PdfParagraphBuilder

Resets the current run font size to the paragraph default font size.

public PdfParagraphBuilder Runs(IEnumerable<TextRun> runs) #
Returns: PdfParagraphBuilder

Adds already prepared rich text runs, preserving their per-run styling and font selections.

Parameters

runs System.Collections.Generic.IEnumerable{OfficeIMO.Pdf.TextRun} requiredposition: 0
public PdfParagraphBuilder Strike(Boolean enable = true) #
Returns: PdfParagraphBuilder

Enables or disables strikethrough for subsequent runs.

Parameters

enable System.Boolean = true optionalposition: 0
public PdfParagraphBuilder Strikethrough(String text, Nullable<PdfColor> color = null) #
Returns: PdfParagraphBuilder

Adds a strikethrough text run.

Parameters

text System.String requiredposition: 0
color System.Nullable{OfficeIMO.Pdf.PdfColor} = null optionalposition: 1
Subscript 2 overloads
public PdfParagraphBuilder Subscript(Boolean enable = true) #
Returns: PdfParagraphBuilder

Enables or disables subscript baseline placement for subsequent runs.

Parameters

enable System.Boolean = true optionalposition: 0
public PdfParagraphBuilder Subscript(String text, Nullable<PdfColor> color = null) #
Returns: PdfParagraphBuilder

Adds a subscript text run.

Parameters

text System.String requiredposition: 0
color System.Nullable{OfficeIMO.Pdf.PdfColor} = null optionalposition: 1
Superscript 2 overloads
public PdfParagraphBuilder Superscript(Boolean enable = true) #
Returns: PdfParagraphBuilder

Enables or disables superscript baseline placement for subsequent runs.

Parameters

enable System.Boolean = true optionalposition: 0
public PdfParagraphBuilder Superscript(String text, Nullable<PdfColor> color = null) #
Returns: PdfParagraphBuilder

Adds a superscript text run.

Parameters

text System.String requiredposition: 0
color System.Nullable{OfficeIMO.Pdf.PdfColor} = null optionalposition: 1
public PdfParagraphBuilder Tab(PdfTabLeaderStyle leader = None, PdfTabAlignment alignment = Left) #
Returns: PdfParagraphBuilder

Adds an explicit paragraph tab using the current style flags.

Parameters

leader OfficeIMO.Pdf.PdfTabLeaderStyle = None optionalposition: 0
alignment OfficeIMO.Pdf.PdfTabAlignment = Left optionalposition: 1
public PdfParagraphBuilder Text(String text) #
Returns: PdfParagraphBuilder

Adds a text run using the current style flags.

Parameters

text System.String requiredposition: 0
public PdfParagraphBuilder Underline(Boolean enable = true) #
Returns: PdfParagraphBuilder

Enables or disables underline for subsequent runs.

Parameters

enable System.Boolean = true optionalposition: 0
public PdfParagraphBuilder Underlined(String text, Nullable<PdfColor> color = null) #
Returns: PdfParagraphBuilder

Adds an underlined text run.

Parameters

text System.String requiredposition: 0
color System.Nullable{OfficeIMO.Pdf.PdfColor} = null optionalposition: 1

Properties

public PdfAlign Align { get; } #

Paragraph alignment.

public Nullable<PdfColor> DefaultColor { get; } #

Default text color applied when no run color is specified.