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
Returns
DefaultType(Func<TypeStyle, TypeStyle>)
Adjusts the style inherited by every span in this paragraph.
public void DefaultType(Func<TypeStyle, TypeStyle> refinement)
Parameters
FirstLineIndent(float)
Indents the opening line of every paragraph in this block.
public void FirstLineIndent(float indent)
Parameters
indentfloat
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
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
Returns
FolioOf(string)
Appends the number of the page an anchor is on, or "?" until it has been reached.
public RunComposer FolioOf(string anchor)
Parameters
anchorstring
Returns
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
Returns
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
anchorstring
Returns
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
Returns
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
handlerAction<IFrame>Composes the frame.
positionInlinePositionWhere 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
anchorstring
Returns
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
Returns
Line(string)
Appends a run of text followed by a line break.
public RunComposer Line(string text)
Parameters
textstring
Returns
Link(string, string)
Appends text that opens an external URL when clicked.
public RunComposer Link(string text, string url)
Parameters
Returns
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
countintThe most lines to show; at least one.
ellipsisstringWhat 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
PageCount(Func<int, string>)
Appends the total number of pages in the document, written by format.
public RunComposer PageCount(Func<int, string> format)
Parameters
Returns
PageCountOf(string)
Appends how many pages an anchor's content spans, or "?" until it has been reached.
public RunComposer PageCountOf(string anchor)
Parameters
anchorstring
Returns
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
Returns
Run(string)
Appends a run of text.
public RunComposer Run(string text)
Parameters
textstring
Returns
SpaceBetweenParagraphs(float)
Inserts a vertical gap before every paragraph after the first.
public void SpaceBetweenParagraphs(float spacing)
Parameters
spacingfloat
Style(string)
Sets the text in the document's paragraph style named name.
public void Style(string name)
Parameters
namestring