LineSpacingRule Enumeration |
Specifies line spacing values for a paragraph.
Namespace: SautinSoft.DocumentAssembly: SautinSoft.Document (in SautinSoft.Document.dll) Version: 2024.11.20
Syntax public enum LineSpacingRule
Public Enumeration LineSpacingRule
Members Member name | Value | Description |
---|
AtLeast | 0 |
The line spacing can be greater than or equal to, but never less than,
the value specified in the LineSpacing property.
|
Exactly | 1 |
The line spacing never changes from the value specified in the LineSpacing property,
even if a larger font is used within the paragraph.
|
Multiple | 2 |
The line spacing is specified in the LineSpacing
property as the number of lines.
|
Example See Developer Guide: Creates a new document with a paragraph
Creates a new document with a paragraph using C#
using SautinSoft.Document;
namespace Example
{
class Program
{
static void Main(string[] args)
{
Paragraph();
}
static void Paragraph()
{
DocumentCore dc = new DocumentCore();
string filePath = @"Result-file.docx";
dc.Sections.Add(
new Section(dc,
new Paragraph(dc, "Text is right aligned.")
{
ParagraphFormat = new ParagraphFormat
{
Alignment = HorizontalAlignment.Right
}
},
new Paragraph(dc, "This paragraph has the following properties: Left indentation is 15 points, right indentation is 5 centimeters, hanging indentation is 10 points, line spacing is exactly 14 points, space before and space after are 10 points.")
{
ParagraphFormat = new ParagraphFormat
{
LeftIndentation = 15,
RightIndentation = LengthUnitConverter.Convert(5, LengthUnit.Centimeter, LengthUnit.Point),
SpecialIndentation = 10,
LineSpacing = 14,
LineSpacingRule = LineSpacingRule.Exactly,
SpaceBefore = 10,
SpaceAfter = 10
}
}));
dc.Save(filePath);
System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo(filePath) { UseShellExecute = true });
}
}
}
Creates a new document with a paragraph using VB.Net
Imports System
Imports System.IO
Imports SautinSoft.Document
Module Sample
Sub Main()
Paragraphs()
End Sub
Public Sub Paragraphs()
Dim dc As New DocumentCore()
Dim filePath As String = "Result-file.docx"
dc.Sections.Add(New Section(dc, New Paragraph(dc, "Text is right aligned.") With {
.ParagraphFormat = New ParagraphFormat With {.Alignment = HorizontalAlignment.Right}
},
New Paragraph(dc, "This paragraph has the following properties: Left indentation is 15 points, right indentation is 5 centimeters, hanging indentation is 10 points, line spacing is exactly 14 points, space before and space after are 10 points.") With {
.ParagraphFormat = New ParagraphFormat With {
.LeftIndentation = 15,
.RightIndentation = LengthUnitConverter.Convert(5, LengthUnit.Centimeter, LengthUnit.Point),
.SpecialIndentation = 10,
.LineSpacing = 14,
.LineSpacingRule = LineSpacingRule.Exactly,
.SpaceBefore = 10,
.SpaceAfter = 10
}
}))
dc.Save(filePath)
System.Diagnostics.Process.Start(New System.Diagnostics.ProcessStartInfo(filePath) With {.UseShellExecute = True})
End Sub
End Module
See Also