Table of Contents

Class TextComposer

Namespace
Rustaveli.Pdf
Assembly
Rustaveli.Pdf.dll

Builds a paragraph out of styled spans.

public sealed class TextComposer
Inheritance
TextComposer
Inherited Members

Methods

BlankLine()

Ends the paragraph's current line with an empty one after it.

public void BlankLine()

Centered()

Centres each line.

public void Centered()

CrossReference(string, string)

Appends text that jumps to a named section when clicked.

public RunComposer CrossReference(string text, string anchor)

Parameters

text string
anchor string

Returns

RunComposer

DefaultType(Func<TypeStyle, TypeStyle>)

Adjusts the style inherited by every span in this paragraph.

public void DefaultType(Func<TypeStyle, TypeStyle> refinement)

Parameters

refinement Func<TypeStyle, TypeStyle>

FirstLineIndent(float)

Indents the opening line of every paragraph in this block.

public void FirstLineIndent(float indent)

Parameters

indent float

FlushEnd()

Sets lines flush against the edge they end at: right in left-to-right text, left in right-to-left.

public void FlushEnd()

FlushLeft()

Sets lines flush against the left edge, whatever the reading direction.

public void FlushLeft()

FlushRight()

Sets lines flush against the right edge, whatever the reading direction.

public void FlushRight()

FlushStart()

Sets lines flush against the edge they start from: left in left-to-right text, right in right-to-left. This is the default.

public void FlushStart()

Folio()

Appends the number of the page this text is drawn on.

public RunComposer Folio()

Returns

RunComposer

Folio(Func<int, string>)

Appends the number of the page this text is drawn on, written by format — such as LowerRoman(int) for front matter.

public RunComposer Folio(Func<int, string> format)

Parameters

format Func<int, string>

Returns

RunComposer

FolioOf(string)

Appends the number of the page an anchor is on, or "?" until it has been reached.

public RunComposer FolioOf(string anchor)

Parameters

anchor string

Returns

RunComposer

FolioOf(string, Func<int, string>)

Appends the number of the page an anchor is on, written by format.

public RunComposer FolioOf(string anchor, Func<int, string> format)

Parameters

anchor string
format Func<int, string>

Returns

RunComposer

FolioWithin(string)

Appends this page's number counted from the page an anchor begins on — "page 2" of a chapter — or "?" until the anchor has been reached.

public RunComposer FolioWithin(string anchor)

Parameters

anchor string

Returns

RunComposer

FolioWithin(string, Func<int, string>)

Appends this page's number counted from the page an anchor begins on, written by format.

public RunComposer FolioWithin(string anchor, Func<int, string> format)

Parameters

anchor string
format Func<int, string>

Returns

RunComposer

Inline(Action<IFrame>, InlinePosition)

Places content inline among the words — an icon, a logo, a small chart.

public void Inline(Action<IFrame> handler, InlinePosition position = InlinePosition.OnBaseline)

Parameters

handler Action<IFrame>

Composes the frame.

position InlinePosition

Where the frame sits against the line; on the baseline unless told otherwise.

Remarks

The frame behaves as one unbreakable word: it sits where position puts it, moves to the next line whole if it does not fit, and deepens the line it lands on to accommodate its height.

Justified()

Stretches every line but the last of each paragraph across the full width by widening the spaces between its words; the last sits flush against the start.

public void Justified()

LastFolioOf(string)

Appends the number of the page an anchor's content ends on — the last page of a chapter anchored by a frame that flows across several — or "?" until it has been reached.

public RunComposer LastFolioOf(string anchor)

Parameters

anchor string

Returns

RunComposer

LastFolioOf(string, Func<int, string>)

Appends the number of the page an anchor's content ends on, written by format.

public RunComposer LastFolioOf(string anchor, Func<int, string> format)

Parameters

anchor string
format Func<int, string>

Returns

RunComposer

Line(string)

Appends a run of text followed by a line break.

public RunComposer Line(string text)

Parameters

text string

Returns

RunComposer

Appends text that opens an external URL when clicked.

public RunComposer Link(string text, string url)

Parameters

text string
url string

Returns

RunComposer

MaxLines(int, string)

Shows at most count lines. Text beyond them is left out, and the last line is cut back until ellipsis fits after it.

public void MaxLines(int count, string ellipsis = "…")

Parameters

count int

The most lines to show; at least one.

ellipsis string

What ends a line cut short; empty to cut without a mark.

PageCount()

Appends the total number of pages in the document. Resolves to a provisional value during the counting pass and to the true total when the document is drawn.

public RunComposer PageCount()

Returns

RunComposer

PageCount(Func<int, string>)

Appends the total number of pages in the document, written by format.

public RunComposer PageCount(Func<int, string> format)

Parameters

format Func<int, string>

Returns

RunComposer

PageCountOf(string)

Appends how many pages an anchor's content spans, or "?" until it has been reached.

public RunComposer PageCountOf(string anchor)

Parameters

anchor string

Returns

RunComposer

PageCountOf(string, Func<int, string>)

Appends how many pages an anchor's content spans, written by format.

public RunComposer PageCountOf(string anchor, Func<int, string> format)

Parameters

anchor string
format Func<int, string>

Returns

RunComposer

Run(string)

Appends a run of text.

public RunComposer Run(string text)

Parameters

text string

Returns

RunComposer

SpaceBetweenParagraphs(float)

Inserts a vertical gap before every paragraph after the first.

public void SpaceBetweenParagraphs(float spacing)

Parameters

spacing float

Style(string)

Sets the text in the document's paragraph style named name.

public void Style(string name)

Parameters

name string