Table of Contents

Class FrameContent

Namespace
Rustaveli.Pdf
Assembly
Rustaveli.Pdf.dll

The content a frame can hold: text, pictures, and the arrangements — stacks, rows, grids, tables and more — that hold further frames of their own.

public static class FrameContent
Inheritance
FrameContent
Inherited Members

Remarks

Each method fills the frame it is called on and returns nothing, because content is where a chain of modifiers ends. A frame holds one piece of content, so filling it a second time fails.

Methods

Artwork(IFrame, Artwork, ImageFitting)

Adds vector artwork, scaled to the frame according to fit and kept vector in the PDF.

public static void Artwork(this IFrame parent, Artwork artwork, ImageFitting fit = ImageFitting.FitWidth)

Parameters

parent IFrame
artwork Artwork
fit ImageFitting

Artwork(IFrame, Func<Extent, Artwork?>)

Adds artwork generated for the box it fills, taking all the room there is — an SVG written for exactly that size, say — stretched to fill it. Returning nothing leaves the box empty.

public static void Artwork(this IFrame parent, Func<Extent, Artwork?> generate)

Parameters

parent IFrame
generate Func<Extent, Artwork>

Banded(IFrame, Action<BandsComposer>)

Adds flowing content framed by bands that repeat on every page.

public static void Banded(this IFrame parent, Action<BandsComposer> handler)

Parameters

parent IFrame
handler Action<BandsComposer>

Blank(IFrame)

States that the frame is left empty on purpose, so that code reading as incomplete says what it means. It changes nothing, and fails for a frame that already holds content, which it would not remove.

public static void Blank(this IFrame parent)

Parameters

parent IFrame

Columns(IFrame, Action<ColumnsComposer>)

Places content side by side.

public static void Columns(this IFrame parent, Action<ColumnsComposer> handler)

Parameters

parent IFrame
handler Action<ColumnsComposer>

Compose(IFrame, Action<IFrame>)

Hands the frame itself to handler, which fills it: a step of composing written as a method of its own and applied in the middle of a chain. This places nothing itself.

public static void Compose(this IFrame parent, Action<IFrame> handler)

Parameters

parent IFrame
handler Action<IFrame>

ComposeLater(IFrame, Action<IFrame>, bool)

Composes the frame's content only when layout first reaches it, and lets it go once it is drawn in full, so a very large document holds only the content of the pages being drawn. Kept, the content is composed once and held instead, which is quicker when the same content is laid out again in every pass over the document.

public static void ComposeLater(this IFrame parent, Action<IFrame> handler, bool keep = false)

Parameters

parent IFrame
handler Action<IFrame>
keep bool

ComposePerPage<TState>(IFrame, IDynamicContent<TState>)

Composes the frame's content afresh for every page it reaches, knowing the page and the room left on it, from the state it got to on the page before.

public static void ComposePerPage<TState>(this IFrame parent, IDynamicContent<TState> content)

Parameters

parent IFrame
content IDynamicContent<TState>

Type Parameters

TState

Flow(IFrame, Action<FlowComposer>)

Adds a flow of items set side by side as words are, wrapping on to a new line wherever the next would not fit.

public static void Flow(this IFrame parent, Action<FlowComposer> handler)

Parameters

parent IFrame
handler Action<FlowComposer>

FlowColumns(IFrame, Action<FlowColumnsComposer>)

Adds columns a story flows through as a newspaper's does: down one, on into the next, and on to the next page.

public static void FlowColumns(this IFrame parent, Action<FlowColumnsComposer> handler)

Parameters

parent IFrame
handler Action<FlowColumnsComposer>

Grid(IFrame, Action<GridComposer>)

Adds a grid of cells flowing into rows of equal columns, each cell spanning one or more.

public static void Grid(this IFrame parent, Action<GridComposer> handler)

Parameters

parent IFrame
handler Action<GridComposer>

Image(IFrame, IImage, ImageFitting)

Adds an image scaled according to fit.

public static void Image(this IFrame parent, IImage image, ImageFitting fit = ImageFitting.FitWidth)

Parameters

parent IFrame
image IImage
fit ImageFitting

Image(IFrame, Func<ImageRequest, byte[]?>)

Adds an image generated for the box it fills, taking all the room there is, at the resolution images are generated at: a chart drawn by another library, say. Returning nothing leaves the box empty.

public static void Image(this IFrame parent, Func<ImageRequest, byte[]?> generate)

Parameters

parent IFrame
generate Func<ImageRequest, byte[]>

Layered(IFrame, Action<LayersComposer>)

Draws content in overlapping layers.

public static void Layered(this IFrame parent, Action<LayersComposer> handler)

Parameters

parent IFrame
handler Action<LayersComposer>

List(IFrame, Action<ListComposer>)

Adds a bulleted or numbered list.

public static void List(this IFrame parent, Action<ListComposer> handler)

Parameters

parent IFrame
handler Action<ListComposer>

Snippet(IFrame, ISnippet)

Has snippet compose its content into this frame, exactly as if its composing were written out here: it adds no frame, room or structure of its own, so the modifiers before it apply to its content as they would to anything else.

public static void Snippet(this IFrame parent, ISnippet snippet)

Parameters

parent IFrame
snippet ISnippet

Snippet<T>(IFrame)

Makes a new T and has it compose its content into this frame.

public static void Snippet<T>(this IFrame parent) where T : ISnippet, new()

Parameters

parent IFrame

Type Parameters

T

Stack(IFrame, Action<StackComposer>)

Stacks content vertically, flowing across pages when it does not fit.

public static void Stack(this IFrame parent, Action<StackComposer> handler)

Parameters

parent IFrame
handler Action<StackComposer>

Table(IFrame, Action<TableComposer>)

Adds a table of cells in declared columns, which runs on to the next page between rows. Its cells are placed and checked once handler returns, so a table that cannot be laid out fails here.

public static void Table(this IFrame parent, Action<TableComposer> handler)

Parameters

parent IFrame
handler Action<TableComposer>

Text(IFrame, Action<TextComposer>)

Adds a paragraph of styled text.

public static void Text(this IFrame parent, Action<TextComposer> handler)

Parameters

parent IFrame
handler Action<TextComposer>

Text(IFrame, string)

Adds a paragraph of plain text, styled only by the style it inherits from around it: the same as a paragraph of one run of text with nothing set on it.

public static void Text(this IFrame parent, string text)

Parameters

parent IFrame
text string