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
parentIFramealignmentStrokeAlignment
Returns
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
Returns
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
Returns
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
Returns
Centered(IFrame)
public static IFrame Centered(this IFrame parent)
Parameters
parentIFrame
Returns
CrossReference(IFrame, string)
public static IFrame CrossReference(this IFrame parent, string anchor)
Parameters
Returns
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
Returns
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
parentIFrame
Returns
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
Returns
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
Returns
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
Returns
Expand(IFrame)
public static IFrame Expand(this IFrame parent)
Parameters
parentIFrame
Returns
ExpandHorizontally(IFrame)
public static IFrame ExpandHorizontally(this IFrame parent)
Parameters
parentIFrame
Returns
ExpandVertically(IFrame)
public static IFrame ExpandVertically(this IFrame parent)
Parameters
parentIFrame
Returns
Fill(IFrame, Gradient)
Paints a gradient behind the content, across the whole frame.
public static IFrame Fill(this IFrame parent, Gradient gradient)
Parameters
Returns
Fill(IFrame, Ink)
public static IFrame Fill(this IFrame parent, Ink ink)
Parameters
Returns
Fill(IFrame, string)
public static IFrame Fill(this IFrame parent, string hex)
Parameters
Returns
FitHeightToContent(IFrame)
Fits the frame's height to its content, keeping all the width there is.
public static IFrame FitHeightToContent(this IFrame parent)
Parameters
parentIFrame
Returns
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
parentIFrame
Returns
FitWidthToContent(IFrame)
Fits the frame's width to its content, keeping all the height there is.
public static IFrame FitWidthToContent(this IFrame parent)
Parameters
parentIFrame
Returns
FlushBottom(IFrame)
public static IFrame FlushBottom(this IFrame parent)
Parameters
parentIFrame
Returns
FlushLeft(IFrame)
public static IFrame FlushLeft(this IFrame parent)
Parameters
parentIFrame
Returns
FlushRight(IFrame)
public static IFrame FlushRight(this IFrame parent)
Parameters
parentIFrame
Returns
FlushTop(IFrame)
public static IFrame FlushTop(this IFrame parent)
Parameters
parentIFrame
Returns
Height(IFrame, float)
public static IFrame Height(this IFrame parent, float value)
Parameters
Returns
Inset(IFrame, float)
public static IFrame Inset(this IFrame parent, float value)
Parameters
Returns
InsetBottom(IFrame, float)
public static IFrame InsetBottom(this IFrame parent, float value)
Parameters
Returns
InsetHorizontal(IFrame, float)
public static IFrame InsetHorizontal(this IFrame parent, float value)
Parameters
Returns
InsetLeft(IFrame, float)
public static IFrame InsetLeft(this IFrame parent, float value)
Parameters
Returns
InsetRight(IFrame, float)
public static IFrame InsetRight(this IFrame parent, float value)
Parameters
Returns
InsetTop(IFrame, float)
public static IFrame InsetTop(this IFrame parent, float value)
Parameters
Returns
InsetVertical(IFrame, float)
public static IFrame InsetVertical(this IFrame parent, float value)
Parameters
Returns
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
parentIFrame
Returns
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
parentIFrame
Returns
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
Returns
LeftToRight(IFrame)
Lays out nested content left to right.
public static IFrame LeftToRight(this IFrame parent)
Parameters
parentIFrame
Returns
Link(IFrame, string)
public static IFrame Link(this IFrame parent, string url)
Parameters
Returns
MaxHeight(IFrame, float)
public static IFrame MaxHeight(this IFrame parent, float value)
Parameters
Returns
MaxWidth(IFrame, float)
public static IFrame MaxWidth(this IFrame parent, float value)
Parameters
Returns
Middle(IFrame)
public static IFrame Middle(this IFrame parent)
Parameters
parentIFrame
Returns
MinHeight(IFrame, float)
public static IFrame MinHeight(this IFrame parent, float value)
Parameters
Returns
MinWidth(IFrame, float)
public static IFrame MinWidth(this IFrame parent, float value)
Parameters
Returns
MirrorBoth(IFrame)
Mirrors the content on both axes, equivalent to a half turn.
public static IFrame MirrorBoth(this IFrame parent)
Parameters
parentIFrame
Returns
MirrorHorizontal(IFrame)
Mirrors the content left to right.
public static IFrame MirrorHorizontal(this IFrame parent)
Parameters
parentIFrame
Returns
MirrorVertical(IFrame)
Mirrors the content top to bottom.
public static IFrame MirrorVertical(this IFrame parent)
Parameters
parentIFrame
Returns
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
Returns
NewPage(IFrame)
public static void NewPage(this IFrame parent)
Parameters
parentIFrame
Once(IFrame)
public static IFrame Once(this IFrame parent)
Parameters
parentIFrame
Returns
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
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
Proportion(IFrame, float, ProportionFit)
public static IFrame Proportion(this IFrame parent, float ratio, ProportionFit fit = ProportionFit.Width)
Parameters
parentIFrameratiofloatfitProportionFit
Returns
Reading(IFrame, ReadingDirection)
Sets the flow direction for everything nested inside.
public static IFrame Reading(this IFrame parent, ReadingDirection direction)
Parameters
parentIFramedirectionReadingDirection
Returns
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
parentIFrame
Returns
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
Returns
RightToLeft(IFrame)
Lays out nested content right to left.
public static IFrame RightToLeft(this IFrame parent)
Parameters
parentIFrame
Returns
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
Returns
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
Returns
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
Returns
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
Returns
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
parentIFrameweightfloatgradientGradientstyleStrokeStyle
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
parentIFrameweightfloatgradientGradientdashesIReadOnlyList<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
parentIFrameweightfloatinkInkdashesIReadOnlyList<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
parentIFrameweightfloatinkInk?styleStrokeStyle
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
Returns
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
Returns
ShiftAcross(IFrame, float)
public static IFrame ShiftAcross(this IFrame parent, float value)
Parameters
Returns
ShiftDown(IFrame, float)
public static IFrame ShiftDown(this IFrame parent, float value)
Parameters
Returns
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
Returns
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
Returns
SkipFirst(IFrame)
public static IFrame SkipFirst(this IFrame parent)
Parameters
parentIFrame
Returns
Stroke(IFrame, float)
public static IFrame Stroke(this IFrame parent, float weight)
Parameters
Returns
StrokeBottom(IFrame, float)
public static IFrame StrokeBottom(this IFrame parent, float weight)
Parameters
Returns
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
Returns
StrokeInk(IFrame, Ink)
Sets the ink of the stroke this directly follows.
public static IFrame StrokeInk(this IFrame parent, Ink ink)
Parameters
Returns
StrokeInk(IFrame, string)
public static IFrame StrokeInk(this IFrame parent, string hex)
Parameters
Returns
StrokeLeft(IFrame, float)
public static IFrame StrokeLeft(this IFrame parent, float weight)
Parameters
Returns
StrokeRight(IFrame, float)
public static IFrame StrokeRight(this IFrame parent, float weight)
Parameters
Returns
StrokeTop(IFrame, float)
public static IFrame StrokeTop(this IFrame parent, float weight)
Parameters
Returns
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
Returns
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
parentIFrametagContentTag
Returns
TurnLeft(IFrame)
Rotates a quarter turn anticlockwise, swapping the layout axes.
public static IFrame TurnLeft(this IFrame parent)
Parameters
parentIFrame
Returns
TurnRight(IFrame)
Rotates a quarter turn clockwise, swapping the layout axes.
public static IFrame TurnRight(this IFrame parent)
Parameters
parentIFrame
Returns
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
parentIFrame
Returns
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
parentIFrame
Returns
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
parentIFrameweightfloatgradientGradientstyleStrokeStyle
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
parentIFrameweightfloatgradientGradientdashesIReadOnlyList<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
parentIFrameweightfloatinkInkdashesIReadOnlyList<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
parentIFrameweightfloatinkInk?styleStrokeStyle
When(IFrame, bool)
public static IFrame When(this IFrame parent, bool condition)
Parameters
Returns
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
Returns
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)