VegaRise.NET
HomeAPI Reference
Back to DOM

SpacingClass

Definition

Namespace
DOM.Styles
Assembly
DOM.dll

Encapsulates paragraph vertical spacing settings.

Remarks

holds spacing before/after a paragraph as well as line spacing controls. Properties are nullable to allow callers to indicate "unspecified" so style inheritance or document defaults may be applied by consumers. Spacing Spacing is configured through . SpacingBetweenLines

Examples

csharp
1// 1. Simple paragraph spacing /// var spacing = new Spacing { Before = 6, After = 6 };
2
csharp
1// 2. Line spacing as a multiple (1.15)
2var spacing = new Spacing
3{
4 Line = 1.15,
5 LineRule = LineSpacingRuleValues.Auto
6};
7
csharp
1// 3. Exact line height in points
2var spacing = new Spacing
3{
4 Line = 18, // 18 pt line pitch
5 LineRule = LineSpacingRuleValues.Exact
6};
7
csharp
1// 4. Line-count based before/after spacing
2var spacing = new Spacing
3{
4 BeforeLines = 2,
5 AfterLines = 1
6};
7
csharp
1// 5. Auto spacing between CJK and Latin characters
2var spacing = new Spacing
3{
4 BeforeAutoSpacing = true,
5 AfterAutoSpacing = true
6};
7
csharp
1// 6. Attach to a ParagraphStyle
2var style = new ParagraphStyle
3{
4 SpacingBetweenLines = new Spacing
5 {
6 Before = new DocumentUnit(0.1, Units.inch),
7 After = new DocumentUnit(0.1, Units.inch),
8 Line = 1.15
9 }
10};
11

Properties

Gets or sets the space inserted after the paragraph.

AfterAutoSpacing

Gets or sets a value indicating whether automatic spacing rules should be applied after the paragraph.

AfterLines

Gets or sets the spacing after the paragraph expressed as a number of lines.

AutoSpaceDE

Gets or sets whether automatic spacing before CJK/Latin characters is enabled (legacy alias).

AutoSpaceDN

Gets or sets whether automatic spacing after CJK/Latin characters is enabled (legacy alias).

Gets or sets the space inserted before the paragraph.

BeforeAutoSpacing

Gets or sets a value indicating whether automatic spacing rules should be applied before the paragraph.

BeforeLines

Gets or sets the spacing before the paragraph expressed as a number of lines.

Gets or sets the line spacing value for the paragraph.

Gets or sets the rule that determines how the value is interpreted. Line