Table of Contents

Class StyleSheet

Namespace
Rustaveli.Pdf
Assembly
Rustaveli.Pdf.dll

A document's named styles: type styles for words, paragraph styles for blocks of text, and frame styles for the frames content sits in — each defined once, able to build on another, and applied by name.

public sealed class StyleSheet
Inheritance
StyleSheet
Inherited Members

Remarks

A style based on another applies the other first and then its own, so Subheading based on Heading takes the heading's typeface and weight and sets only its own size. Styles are applied where they are named, as the document is composed, so a style is defined before content names it.

Named styles and inline settings mix as the calls do: Style("Emphasis").Bold() makes emphasis bold, and a setting made before a named style is overridden by what the style sets.

Methods

DefineFrame(string, Func<IFrame, IFrame>, string?)

Defines a frame style: the frame settings a frame named with it takes, such as frame => frame.Inset(8).Fill(Ink.Hex("#EEEEEE")), returning the frame content goes in.

public StyleSheet DefineFrame(string name, Func<IFrame, IFrame> frame, string? basedOn = null)

Parameters

name string
frame Func<IFrame, IFrame>
basedOn string

Returns

StyleSheet

DefineParagraph(string, Action<TextComposer>, string?)

Defines a paragraph style: how a block of text named with it is set — its alignment, indent and spacing, and the type its words take — such as text => { text.Justified(); text.FirstLineIndent(12); }.

public StyleSheet DefineParagraph(string name, Action<TextComposer> format, string? basedOn = null)

Parameters

name string
format Action<TextComposer>
basedOn string

Returns

StyleSheet

DefineType(string, Func<TypeStyle, TypeStyle>, string?)

Defines a type style: how words named with it are set, such as style => style.Italic().

public StyleSheet DefineType(string name, Func<TypeStyle, TypeStyle> style, string? basedOn = null)

Parameters

name string
style Func<TypeStyle, TypeStyle>
basedOn string

Returns

StyleSheet