Table of Contents

Class FrameModifiers

Namespace
Rustaveli.Pdf
Assembly
Rustaveli.Pdf.dll

Composition methods for spacing, sizing, alignment and flow control.

public static class FrameModifiers
Inheritance
FrameModifiers
Inherited Members

Remarks

Most methods place one block into the frame they are called on and return the frame inside that block, so a chain such as .Inset(10).Fill(...) nests one block in the next rather than collecting settings on one. The exceptions are the stroke and fill configurators — StrokeInk, AlignStroke and RoundCorners — which place nothing and adjust the block placed just before them, and the alignment methods, which combine with one another while the block they placed still holds nothing.

Methods

AlignStroke(IFrame, StrokeAlignment)

Sets where the stroke this directly follows lies against the frame's edge: inside it, the default, centred on it, or outside it.

public static IFrame AlignStroke(this IFrame parent, StrokeAlignment alignment)

Parameters

parent IFrame
alignment StrokeAlignment

Returns

IFrame

Anchor(IFrame, string)

Marks this content as a named destination that CrossReference(IFrame, string) can target.

public static IFrame Anchor(this IFrame parent, string name)

Parameters

parent IFrame
name string

Returns

IFrame

Bookmark(IFrame, string, int)

Adds a bookmark to the document's outline, the list of contents a viewer shows beside the pages, leading to where this content starts. level nests it: 1 for a chapter, 2 for a section within it, and so on, each under the nearest bookmark before it of a shallower level.

public static IFrame Bookmark(this IFrame parent, string title, int level = 1)

Parameters

parent IFrame
title string
level int

Returns

IFrame

CapturePosition(IFrame, string)

Records where the content is drawn, on every page it is drawn on, under name, for content composed page by page to look up.

public static IFrame CapturePosition(this IFrame parent, string name)

Parameters

parent IFrame
name string

Returns

IFrame

Centered(IFrame)

public static IFrame Centered(this IFrame parent)

Parameters

parent IFrame

Returns

IFrame

CrossReference(IFrame, string)

public static IFrame CrossReference(this IFrame parent, string anchor)

Parameters

parent IFrame
anchor string

Returns

IFrame

DefaultType(IFrame, Func<TypeStyle, TypeStyle>)

Adjusts the style inherited by all text nested inside.

public static IFrame DefaultType(this IFrame parent, Func<TypeStyle, TypeStyle> refinement)

Parameters

parent IFrame
refinement Func<TypeStyle, TypeStyle>

Returns

IFrame

DiscardOverset(IFrame)

Draws as much of the content as fits where it first appears and discards the overset, the rest that does not fit, instead of continuing it on the next page. Content that fits nowhere takes no room.

public static IFrame DiscardOverset(this IFrame parent)

Parameters

parent IFrame

Returns

IFrame

DrawOrder(IFrame, int)

Sets the order the frame is drawn in: content of a higher order is drawn over content of a lower one wherever it sits on the page, whatever order it comes in. Everything is of order zero unless it, or a frame around it, says otherwise; negative orders are drawn beneath.

public static IFrame DrawOrder(this IFrame parent, int order)

Parameters

parent IFrame
order int

Returns

IFrame

DropShadow(IFrame, Ink, float, float, float, float)

Casts a shadow of ink, blurred by blur and moved by the offset.

public static IFrame DropShadow(this IFrame parent, Ink ink, float blur, float offsetX = 0, float offsetY = 0, float spread = 0)

Parameters

parent IFrame
ink Ink
blur float
offsetX float
offsetY float
spread float

Returns

IFrame

DropShadow(IFrame, Shadow)

Casts a shadow from the frame onto what lies beneath it. Round its corners with RoundCorners(IFrame, float) directly after, to match a rounded fill.

public static IFrame DropShadow(this IFrame parent, Shadow shadow)

Parameters

parent IFrame
shadow Shadow

Returns

IFrame

Expand(IFrame)

public static IFrame Expand(this IFrame parent)

Parameters

parent IFrame

Returns

IFrame

ExpandHorizontally(IFrame)

public static IFrame ExpandHorizontally(this IFrame parent)

Parameters

parent IFrame

Returns

IFrame

ExpandVertically(IFrame)

public static IFrame ExpandVertically(this IFrame parent)

Parameters

parent IFrame

Returns

IFrame

Fill(IFrame, Gradient)

Paints a gradient behind the content, across the whole frame.

public static IFrame Fill(this IFrame parent, Gradient gradient)

Parameters

parent IFrame
gradient Gradient

Returns

IFrame

Fill(IFrame, Ink)

public static IFrame Fill(this IFrame parent, Ink ink)

Parameters

parent IFrame
ink Ink

Returns

IFrame

Fill(IFrame, string)

public static IFrame Fill(this IFrame parent, string hex)

Parameters

parent IFrame
hex string

Returns

IFrame

FitHeightToContent(IFrame)

Fits the frame's height to its content, keeping all the width there is.

public static IFrame FitHeightToContent(this IFrame parent)

Parameters

parent IFrame

Returns

IFrame

FitToContent(IFrame)

Fits the frame to its content: whatever follows is given the content's own size rather than all the room there is, so a fill or stroke hugs it. Across, the content starts where the reading direction does.

public static IFrame FitToContent(this IFrame parent)

Parameters

parent IFrame

Returns

IFrame

FitWidthToContent(IFrame)

Fits the frame's width to its content, keeping all the height there is.

public static IFrame FitWidthToContent(this IFrame parent)

Parameters

parent IFrame

Returns

IFrame

FlushBottom(IFrame)

public static IFrame FlushBottom(this IFrame parent)

Parameters

parent IFrame

Returns

IFrame

FlushLeft(IFrame)

public static IFrame FlushLeft(this IFrame parent)

Parameters

parent IFrame

Returns

IFrame

FlushRight(IFrame)

public static IFrame FlushRight(this IFrame parent)

Parameters

parent IFrame

Returns

IFrame

FlushTop(IFrame)

public static IFrame FlushTop(this IFrame parent)

Parameters

parent IFrame

Returns

IFrame

Height(IFrame, float)

public static IFrame Height(this IFrame parent, float value)

Parameters

parent IFrame
value float

Returns

IFrame

Inset(IFrame, float)

public static IFrame Inset(this IFrame parent, float value)

Parameters

parent IFrame
value float

Returns

IFrame

InsetBottom(IFrame, float)

public static IFrame InsetBottom(this IFrame parent, float value)

Parameters

parent IFrame
value float

Returns

IFrame

InsetHorizontal(IFrame, float)

public static IFrame InsetHorizontal(this IFrame parent, float value)

Parameters

parent IFrame
value float

Returns

IFrame

InsetLeft(IFrame, float)

public static IFrame InsetLeft(this IFrame parent, float value)

Parameters

parent IFrame
value float

Returns

IFrame

InsetRight(IFrame, float)

public static IFrame InsetRight(this IFrame parent, float value)

Parameters

parent IFrame
value float

Returns

IFrame

InsetTop(IFrame, float)

public static IFrame InsetTop(this IFrame parent, float value)

Parameters

parent IFrame
value float

Returns

IFrame

InsetVertical(IFrame, float)

public static IFrame InsetVertical(this IFrame parent, float value)

Parameters

parent IFrame
value float

Returns

IFrame

KeepTogether(IFrame)

Prevents content from being split across pages, moving it whole to the next page instead.

public static IFrame KeepTogether(this IFrame parent)

Parameters

parent IFrame

Returns

IFrame

KeepTogetherWherePossible(IFrame)

Keeps the frame on one page where it can be: moved whole to the next page when it does not fit on this one but would on a fresh one, and split like any other content when it is longer than a page.

public static IFrame KeepTogetherWherePossible(this IFrame parent)

Parameters

parent IFrame

Returns

IFrame

Language(IFrame, string)

Sets the language of this content, as a tag such as en-GB or ka, where it differs from the document's, so screen readers pronounce it right.

public static IFrame Language(this IFrame parent, string language)

Parameters

parent IFrame
language string

Returns

IFrame

LeftToRight(IFrame)

Lays out nested content left to right.

public static IFrame LeftToRight(this IFrame parent)

Parameters

parent IFrame

Returns

IFrame
public static IFrame Link(this IFrame parent, string url)

Parameters

parent IFrame
url string

Returns

IFrame

MaxHeight(IFrame, float)

public static IFrame MaxHeight(this IFrame parent, float value)

Parameters

parent IFrame
value float

Returns

IFrame

MaxWidth(IFrame, float)

public static IFrame MaxWidth(this IFrame parent, float value)

Parameters

parent IFrame
value float

Returns

IFrame

Middle(IFrame)

public static IFrame Middle(this IFrame parent)

Parameters

parent IFrame

Returns

IFrame

MinHeight(IFrame, float)

public static IFrame MinHeight(this IFrame parent, float value)

Parameters

parent IFrame
value float

Returns

IFrame

MinWidth(IFrame, float)

public static IFrame MinWidth(this IFrame parent, float value)

Parameters

parent IFrame
value float

Returns

IFrame

MirrorBoth(IFrame)

Mirrors the content on both axes, equivalent to a half turn.

public static IFrame MirrorBoth(this IFrame parent)

Parameters

parent IFrame

Returns

IFrame

MirrorHorizontal(IFrame)

Mirrors the content left to right.

public static IFrame MirrorHorizontal(this IFrame parent)

Parameters

parent IFrame

Returns

IFrame

MirrorVertical(IFrame)

Mirrors the content top to bottom.

public static IFrame MirrorVertical(this IFrame parent)

Parameters

parent IFrame

Returns

IFrame

Named(IFrame, string)

Names the frame, so a layout failure inside it says where by that name: "Invoice lines" rather than a chain of stacks and tables.

public static IFrame Named(this IFrame parent, string label)

Parameters

parent IFrame
label string

Returns

IFrame

NewPage(IFrame)

public static void NewPage(this IFrame parent)

Parameters

parent IFrame

Once(IFrame)

public static IFrame Once(this IFrame parent)

Parameters

parent IFrame

Returns

IFrame

Placeholder(IFrame, Ink?)

Fills the available space with a block standing in for unwritten content.

public static void Placeholder(this IFrame parent, Ink? ink = null)

Parameters

parent IFrame
ink Ink?

Placeholder(IFrame, string, Ink?)

Fills the available space with a block standing in for unwritten content, saying what will go there.

public static void Placeholder(this IFrame parent, string label, Ink? ink = null)

Parameters

parent IFrame
label string
ink Ink?

Proportion(IFrame, float, ProportionFit)

public static IFrame Proportion(this IFrame parent, float ratio, ProportionFit fit = ProportionFit.Width)

Parameters

parent IFrame
ratio float
fit ProportionFit

Returns

IFrame

Reading(IFrame, ReadingDirection)

Sets the flow direction for everything nested inside.

public static IFrame Reading(this IFrame parent, ReadingDirection direction)

Parameters

parent IFrame
direction ReadingDirection

Returns

IFrame

RepeatOnEachPage(IFrame)

Draws the content again on every page the frame around it continues onto: a row's column is drawn afresh beside the columns still going, instead of being left empty once its content is used up.

public static IFrame RepeatOnEachPage(this IFrame parent)

Parameters

parent IFrame

Returns

IFrame

RequireSpace(IFrame, float)

Defers the content to the next page unless at least minHeight remains, so a heading or short block is never stranded at the bottom of a page.

public static IFrame RequireSpace(this IFrame parent, float minHeight)

Parameters

parent IFrame
minHeight float

Returns

IFrame

RightToLeft(IFrame)

Lays out nested content right to left.

public static IFrame RightToLeft(this IFrame parent)

Parameters

parent IFrame

Returns

IFrame

Rotate(IFrame, float)

Rotates by any angle in degrees, clockwise, about the centre of the frame. Layout is unaffected: the content keeps the room it was given and may reach past it. For quarter turns that swap the layout axes, use TurnLeft(IFrame) or TurnRight(IFrame).

public static IFrame Rotate(this IFrame parent, float degrees)

Parameters

parent IFrame
degrees float

Returns

IFrame

RoundCorners(IFrame, Corners)

Rounds each corner of the fill, stroke or shadow this directly follows to its radius in corners.

public static IFrame RoundCorners(this IFrame parent, Corners corners)

Parameters

parent IFrame
corners Corners

Returns

IFrame

RoundCorners(IFrame, float)

Rounds the corners of the fill, stroke or shadow this directly follows.

public static IFrame RoundCorners(this IFrame parent, float radius)

Parameters

parent IFrame
radius float

Returns

IFrame

RoundCorners(IFrame, float, float, float, float)

Rounds each corner of the fill or stroke this directly follows to its own radius, clockwise from the top left; zero leaves a corner square.

public static IFrame RoundCorners(this IFrame parent, float topLeft, float topRight, float bottomRight, float bottomLeft)

Parameters

parent IFrame
topLeft float
topRight float
bottomRight float
bottomLeft float

Returns

IFrame

Rule(IFrame, float, Gradient, StrokeStyle)

Draws a horizontal rule across the available width in a gradient along its length.

public static void Rule(this IFrame parent, float weight, Gradient gradient, StrokeStyle style = StrokeStyle.Solid)

Parameters

parent IFrame
weight float
gradient Gradient
style StrokeStyle

Rule(IFrame, float, Gradient, IReadOnlyList<float>)

Draws a horizontal rule in a gradient, in dashes and gaps of the lengths in dashes.

public static void Rule(this IFrame parent, float weight, Gradient gradient, IReadOnlyList<float> dashes)

Parameters

parent IFrame
weight float
gradient Gradient
dashes IReadOnlyList<float>

Rule(IFrame, float, Ink, IReadOnlyList<float>)

Draws a horizontal rule across the available width in dashes and gaps of the lengths in dashes, alternating and starting with a dash: [4, 2] is dashes of 4 points 2 apart.

public static void Rule(this IFrame parent, float weight, Ink ink, IReadOnlyList<float> dashes)

Parameters

parent IFrame
weight float
ink Ink
dashes IReadOnlyList<float>

Rule(IFrame, float, Ink?, StrokeStyle)

Draws a horizontal rule across the available width, solid unless style says otherwise. A wavy rule takes three times its weight, the wave swinging a weight either side of its centre.

public static void Rule(this IFrame parent, float weight = 1, Ink? ink = null, StrokeStyle style = StrokeStyle.Solid)

Parameters

parent IFrame
weight float
ink Ink?
style StrokeStyle

Scale(IFrame, float)

Scales the content by factor each way: negative mirrors it, zero is refused.

public static IFrame Scale(this IFrame parent, float factor)

Parameters

parent IFrame
factor float

Returns

IFrame

Scale(IFrame, float, float)

Scales the content across and down: negative mirrors it, zero is refused.

public static IFrame Scale(this IFrame parent, float scaleX, float scaleY)

Parameters

parent IFrame
scaleX float
scaleY float

Returns

IFrame

ShiftAcross(IFrame, float)

public static IFrame ShiftAcross(this IFrame parent, float value)

Parameters

parent IFrame
value float

Returns

IFrame

ShiftDown(IFrame, float)

public static IFrame ShiftDown(this IFrame parent, float value)

Parameters

parent IFrame
value float

Returns

IFrame

ShowFrameEdges(IFrame, string?, Ink?)

Shows the frame's edges — the room it was given — as a dashed outline over its content, labelled in the top corner if label is given, in ink or a strong red: for seeing where frames lie while a document is laid out.

public static IFrame ShowFrameEdges(this IFrame parent, string? label = null, Ink? ink = null)

Parameters

parent IFrame
label string
ink Ink?

Returns

IFrame

ShrinkToFit(IFrame, float)

Shrinks the content just enough to fit the space available, to no less than minScale of its size: more than zero, and at most 1.

public static IFrame ShrinkToFit(this IFrame parent, float minScale = 0.25)

Parameters

parent IFrame
minScale float

Returns

IFrame

SkipFirst(IFrame)

public static IFrame SkipFirst(this IFrame parent)

Parameters

parent IFrame

Returns

IFrame

Stroke(IFrame, float)

public static IFrame Stroke(this IFrame parent, float weight)

Parameters

parent IFrame
weight float

Returns

IFrame

StrokeBottom(IFrame, float)

public static IFrame StrokeBottom(this IFrame parent, float weight)

Parameters

parent IFrame
weight float

Returns

IFrame

StrokeInk(IFrame, Gradient)

Paints the stroke this directly follows in a gradient, laid across everything the stroke covers.

public static IFrame StrokeInk(this IFrame parent, Gradient gradient)

Parameters

parent IFrame
gradient Gradient

Returns

IFrame

StrokeInk(IFrame, Ink)

Sets the ink of the stroke this directly follows.

public static IFrame StrokeInk(this IFrame parent, Ink ink)

Parameters

parent IFrame
ink Ink

Returns

IFrame

StrokeInk(IFrame, string)

public static IFrame StrokeInk(this IFrame parent, string hex)

Parameters

parent IFrame
hex string

Returns

IFrame

StrokeLeft(IFrame, float)

public static IFrame StrokeLeft(this IFrame parent, float weight)

Parameters

parent IFrame
weight float

Returns

IFrame

StrokeRight(IFrame, float)

public static IFrame StrokeRight(this IFrame parent, float weight)

Parameters

parent IFrame
weight float

Returns

IFrame

StrokeTop(IFrame, float)

public static IFrame StrokeTop(this IFrame parent, float weight)

Parameters

parent IFrame
weight float

Returns

IFrame

Style(IFrame, string)

Gives the frame the document's frame style named name, returning the frame content goes in.

public static IFrame Style(this IFrame parent, string name)

Parameters

parent IFrame
name string

Returns

IFrame

Tagged(IFrame, ContentTag)

Tags this content with the part it plays in the document's structure — a heading, a figure — for screen readers, reflow and search, when the export is tagged.

public static IFrame Tagged(this IFrame parent, ContentTag tag)

Parameters

parent IFrame
tag ContentTag

Returns

IFrame

TurnLeft(IFrame)

Rotates a quarter turn anticlockwise, swapping the layout axes.

public static IFrame TurnLeft(this IFrame parent)

Parameters

parent IFrame

Returns

IFrame

TurnRight(IFrame)

Rotates a quarter turn clockwise, swapping the layout axes.

public static IFrame TurnRight(this IFrame parent)

Parameters

parent IFrame

Returns

IFrame

Unbounded(IFrame)

Lets content exceed the space offered to it while reporting no size to its parent.

public static IFrame Unbounded(this IFrame parent)

Parameters

parent IFrame

Returns

IFrame

Untagged(IFrame)

Leaves this content out of the document's structure, as decoration no screen reader reads: a rule, a watermark, a flourish.

public static IFrame Untagged(this IFrame parent)

Parameters

parent IFrame

Returns

IFrame

VerticalRule(IFrame, float, Gradient, StrokeStyle)

Draws a vertical rule down the available height in a gradient along its length.

public static void VerticalRule(this IFrame parent, float weight, Gradient gradient, StrokeStyle style = StrokeStyle.Solid)

Parameters

parent IFrame
weight float
gradient Gradient
style StrokeStyle

VerticalRule(IFrame, float, Gradient, IReadOnlyList<float>)

Draws a vertical rule in a gradient, in dashes and gaps of the lengths in dashes.

public static void VerticalRule(this IFrame parent, float weight, Gradient gradient, IReadOnlyList<float> dashes)

Parameters

parent IFrame
weight float
gradient Gradient
dashes IReadOnlyList<float>

VerticalRule(IFrame, float, Ink, IReadOnlyList<float>)

Draws a vertical rule down the available height in dashes and gaps of the lengths in dashes.

public static void VerticalRule(this IFrame parent, float weight, Ink ink, IReadOnlyList<float> dashes)

Parameters

parent IFrame
weight float
ink Ink
dashes IReadOnlyList<float>

VerticalRule(IFrame, float, Ink?, StrokeStyle)

Draws a vertical rule down the available height, solid unless style says otherwise.

public static void VerticalRule(this IFrame parent, float weight = 1, Ink? ink = null, StrokeStyle style = StrokeStyle.Solid)

Parameters

parent IFrame
weight float
ink Ink?
style StrokeStyle

When(IFrame, bool)

public static IFrame When(this IFrame parent, bool condition)

Parameters

parent IFrame
condition bool

Returns

IFrame

When(IFrame, Func<PageFacts, bool>)

Shows the content only on pages condition accepts, such as odd pages or all but the first.

public static IFrame When(this IFrame parent, Func<PageFacts, bool> condition)

Parameters

parent IFrame
condition Func<PageFacts, bool>

Returns

IFrame

Remarks

The page count is null until the engine has counted the pages. Content shown or hidden by it can change that count, so it suits content of a fixed size, such as a mark in a margin, rather than content in the flow.

Width(IFrame, float)

public static IFrame Width(this IFrame parent, float value)

Parameters

parent IFrame
value float

Returns

IFrame