Table of Contents

Class TextParagraphBuilder

Namespace
OdfKit.Text
Assembly
OdfKit.dll

Builds paragraph text runs with a fluent API. 提供段落文字片段的 Fluent 建立 API。

public sealed class TextParagraphBuilder
Inheritance
TextParagraphBuilder
Inherited Members

Methods

AddChart(OdfChartDefinition, OdfLength, OdfLength)

Adds an embedded chart. 新增嵌入圖表。

public TextParagraphBuilder AddChart(OdfChartDefinition chart, OdfLength width, OdfLength height)

Parameters

chart OdfChartDefinition

The chart definition. / 圖表定義。

width OdfLength

The chart width. / 圖表寬度。

height OdfLength

The chart height. / 圖表高度。

Returns

TextParagraphBuilder

The current builder instance. / 目前 builder 執行個體。

AddComment(string, string)

Adds a document comment. 新增註解。

public TextParagraphBuilder AddComment(string author, string text)

Parameters

author string

The author name. / 作者名稱。

text string

The comment content. / 註解內容。

Returns

TextParagraphBuilder

The current builder instance. / 目前 builder 執行個體。

AddFootnote(string, string)

Adds a footnote to the document. 新增腳註。

public TextParagraphBuilder AddFootnote(string citation, string bodyText)

Parameters

citation string

The footnote citation marker. / 腳註引用標記。

bodyText string

The footnote body text. / 腳註本文。

Returns

TextParagraphBuilder

The current builder instance. / 目前 builder 執行個體。

AddImage(byte[], OdfLength, OdfLength)

Short overload of AddImage that accepts imageBytes, width, and height; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 imageBytes、width 與 height;其餘可選參數使用預設值並轉呼叫最長 AddImage 多載。

public TextParagraphBuilder AddImage(byte[] imageBytes, OdfLength width, OdfLength height)

Parameters

imageBytes byte[]
width OdfLength
height OdfLength

Returns

TextParagraphBuilder

AddImage(byte[], OdfLength, OdfLength, string?)

Adds an image frame. 新增圖片框架。

public TextParagraphBuilder AddImage(byte[] imageBytes, OdfLength width, OdfLength height, string? name)

Parameters

imageBytes byte[]

The image bytes. / 圖片位元組。

width OdfLength

The image width. / 圖片寬度。

height OdfLength

The image height. / 圖片高度。

name string

The image name. / 圖片名稱。

Returns

TextParagraphBuilder

The current builder instance. / 目前 builder 執行個體。

Append(string)

Appends a plain text run. 新增純文字片段。

public TextParagraphBuilder Append(string text)

Parameters

text string

The text content. / 文字內容。

Returns

TextParagraphBuilder

The current builder instance. / 目前 builder 執行個體。

Append(string, Action<TextRunFormattingBuilder>)

Appends a formatted text run. 新增帶格式的文字片段。

public TextParagraphBuilder Append(string text, Action<TextRunFormattingBuilder> configure)

Parameters

text string

The text content. / 文字內容。

configure Action<TextRunFormattingBuilder>

The format configuration delegate. / 格式設定委派。

Returns

TextParagraphBuilder

The current builder instance. / 目前 builder 執行個體。