VegaRise.NET
Back to DOM

PlacementPositionClass

Definition

Namespace
DOM.Elements.TableElements
Assembly
DOM.dll

Represents positional and anchoring information for an element within the document layout.

Remarks

defines how an element is positioned relative to surrounding text, page boundaries, margins, or other reference frames. It combines an optional object with directional offsets, horizontal and vertical anchors, and alignment values. The class corresponds to the anchor and offset elements used by floating tables, shapes, and images in WordprocessingML and DrawingML. PlacementPosition Position All properties are nullable so that callers can distinguish between an explicit value and "not specified". Consumers (layout engines, serializers) should treat as "use the parent or document default". null

Examples

csharp
1// 1. Anchor a table to page margins and offset from the left text edge
2var placement = new PlacementPosition
3{
4 HorizantalAnchor = AnchorValues.Margin,
5 VerticalAnchor = AnchorValues.Page,
6 LeftFromText = new DocumentUnit(0.25, Units.inch),
7};
8
csharp
1// 2. Align an element horizontally and vertically using alignment values
2var placement = new PlacementPosition
3{
4 HorizantalAlignment = HorizontalAlignmentValues.Center,
5 VerticalAlignment = VerticalAlignmentValues.center,
6};
7
csharp
1// 3. Absolute positioning using the nested Position object
2var placement = new PlacementPosition
3{
4 Position = new Position(100, 200, Units.pt),
5 HorizantalAnchor = AnchorValues.Page,
6 VerticalAnchor = AnchorValues.Page,
7};
8
csharp
1// 4. Combine offset, anchor, and alignment for fine control
2var placement = new PlacementPosition
3{
4 TopFromText = new DocumentUnit(6, Units.pt),
5 BottomFromText = new DocumentUnit(6, Units.pt),
6 HorizantalAnchor = AnchorValues.Margin,
7 VerticalAnchor = AnchorValues.Text,
8 HorizantalAlignment = HorizontalAlignmentValues.Left,
9};
10

Properties

BottomFromTextDocumentUnit

Gets or sets the vertical offset from the bottom edge of the reference text or anchor.

HorizantalAlignmentHorizontalAlignmentValues

Gets or sets the horizontal alignment applied to the element when positioned within its horizontal anchor frame.

HorizantalAnchorAnchorValues

Gets or sets the horizontal anchoring behavior that determines whether the element is anchored to margins, page, column, or text boundaries.

The anchor determines what the horizontal offsets and alignments are measured against. For example, means offsets are relative to the page margins. AnchorValues.Margin

LeftFromTextDocumentUnit

Gets or sets the horizontal offset from the left edge of the reference text or anchor.

Position

Gets or sets the positioning mode applied to the element, such as relative or absolute placement.

When set, this property takes precedence over the offset/alignment values and provides a schema-safe abstraction for floating elements.

RightFromTextDocumentUnit

Gets or sets the horizontal offset from the right edge of the reference text or anchor.

TopFromTextDocumentUnit

Gets or sets the vertical offset from the top edge of the reference text or anchor.

VerticalAlignmentVerticalAlignmentValues

Gets or sets the vertical alignment applied to the element when positioned within its vertical anchor frame.

VerticalAnchorAnchorValues

Gets or sets the vertical anchoring behavior that determines whether the element is anchored to margins, page, paragraph, or line boundaries.

VegaRise.NET

Sign In

Welcome back. Please sign in to your account.

Forgot password?
or

Don't have an account? Create an account

By signing in, you agree to our Terms of Service and Privacy Policy.