Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/

API Reference

Class

PdfParagraphBuilder

Namespace OfficeIMO.Pdf
Assembly OfficeIMO.Pdf
Source revision c0f9d93a0daa with working tree changes
Modifiers sealed

Fluent builder for rich paragraphs made of styled text runs.

Inheritance

  • Object
  • PdfParagraphBuilder

Usage

Explore 34 API references to this type

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

Accepted by parameters 2

Constructors

public PdfParagraphBuilder(PdfAlign align, PdfColor? defaultColor) #

Create a new paragraph builder.

Parameters

align OfficeIMO.Pdf.PdfAlign requiredposition: 0
Paragraph alignment.
defaultColor 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, PdfColor? color = null) #
Returns: PdfParagraphBuilder

Adds a bold text run.

Parameters

text System.String requiredposition: 0
color OfficeIMO.Pdf.PdfColor? = null optionalposition: 1
public PdfParagraphBuilder CharacterSpacing(Double points) #
Returns: PdfParagraphBuilder

Sets additional advance after each rendered glyph, in page points, for subsequent text.

Parameters

points System.Double requiredposition: 0
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 FeatureSettings(OfficeTextFeatureSettings settings) #
Returns: PdfParagraphBuilder

Sets OpenType feature overrides for subsequent text runs, including kerning.

Parameters

settings OfficeIMO.Drawing.OfficeTextFeatureSettings requiredposition: 0
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 HorizontalTextScaling(Double percentage) #
Returns: PdfParagraphBuilder

Sets the horizontal glyph width percentage for subsequent text. Use 100 for normal width.

Parameters

percentage 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, PdfColor? background = null, 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 OfficeIMO.Pdf.PdfColor? = null optionalposition: 2
borderColor 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, PdfColor? color = null) #
Returns: PdfParagraphBuilder

Adds an italic text run.

Parameters

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

Adds an explicit line break using the current run style.

public PdfParagraphBuilder LinkToBookmark(String text, String bookmarkName, 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 PdfDocument.Bookmark.
color 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 ResetFeatureSettings() #
Returns: PdfParagraphBuilder

Resets subsequent text runs to the default OpenType feature policy.

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<PdfTextRun> 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.PdfTextRun> requiredposition: 0
Strike 2 overloads
public PdfParagraphBuilder Strike(Boolean enable = true) #
Returns: PdfParagraphBuilder

Enables or disables strikethrough for subsequent runs.

Parameters

enable System.Boolean = true optionalposition: 0
public PdfParagraphBuilder Strike(OfficeTextDecorationStyle style) #
Returns: PdfParagraphBuilder

Sets the strikethrough pattern for subsequent runs.

Parameters

style OfficeIMO.Drawing.OfficeTextDecorationStyle requiredposition: 0
Strikethrough 2 overloads
public PdfParagraphBuilder Strikethrough(String text, PdfColor? color = null) #
Returns: PdfParagraphBuilder

Adds a strikethrough text run.

Parameters

text System.String requiredposition: 0
color OfficeIMO.Pdf.PdfColor? = null optionalposition: 1
public PdfParagraphBuilder Strikethrough(String text, OfficeTextDecorationStyle style, PdfColor? color = null) #
Returns: PdfParagraphBuilder

Adds a text run with the requested strikethrough pattern.

Parameters

text System.String requiredposition: 0
style OfficeIMO.Drawing.OfficeTextDecorationStyle requiredposition: 1
color OfficeIMO.Pdf.PdfColor? = null optionalposition: 2
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, PdfColor? color = null) #
Returns: PdfParagraphBuilder

Adds a subscript text run.

Parameters

text System.String requiredposition: 0
color 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, PdfColor? color = null) #
Returns: PdfParagraphBuilder

Adds a superscript text run.

Parameters

text System.String requiredposition: 0
color OfficeIMO.Pdf.PdfColor? = null optionalposition: 1
Tab 2 overloads
public PdfParagraphBuilder Tab(PdfTabLeaderStyle leader) #
Returns: PdfParagraphBuilder

Adds an explicit paragraph tab using the current style flags.

Parameters

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

Adds an aligned 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
Underline 2 overloads
public PdfParagraphBuilder Underline(Boolean enable = true) #
Returns: PdfParagraphBuilder

Enables or disables underline for subsequent runs.

Parameters

enable System.Boolean = true optionalposition: 0
public PdfParagraphBuilder Underline(OfficeTextDecorationStyle style) #
Returns: PdfParagraphBuilder

Sets the underline pattern for subsequent runs.

Parameters

style OfficeIMO.Drawing.OfficeTextDecorationStyle requiredposition: 0
Underlined 2 overloads
public PdfParagraphBuilder Underlined(String text, PdfColor? color = null) #
Returns: PdfParagraphBuilder

Adds an underlined text run.

Parameters

text System.String requiredposition: 0
color OfficeIMO.Pdf.PdfColor? = null optionalposition: 1
public PdfParagraphBuilder Underlined(String text, OfficeTextDecorationStyle style, PdfColor? color = null) #
Returns: PdfParagraphBuilder

Adds a text run with the requested underline pattern.

Parameters

text System.String requiredposition: 0
style OfficeIMO.Drawing.OfficeTextDecorationStyle requiredposition: 1
color OfficeIMO.Pdf.PdfColor? = null optionalposition: 2

Properties

public PdfAlign Align { get; } #

Paragraph alignment.

public PdfColor? DefaultColor { get; } #

Default text color applied when no run color is specified.