Specifies text alignment in a paragraph.
[Visual Basic]
Public Enum ParagraphAlignment
[C#]public enum ParagraphAlignment
Remarks
Example
Creates a simple Hello World document.
[C#]
Document doc = new Document();
Range range = doc.GetRange();
range.Text = "Hello World!";
range.Font.Name = "Arial";
range.Font.Size = 48;
range.Font.Italic = true;
range.Font.Color = Color.Red;
range.ParagraphFormat.SpaceBefore = 24;
range.ParagraphFormat.Alignment = ParagraphAlignment.Center;
range.ParagraphFormat.SpaceAfter = 24;
doc.Save(MyPath + "ExRange.HelloWorld Out.xml");
[Visual Basic]
Dim doc As New Document()
Dim range As Range = doc.GetRange()
range.Text = "Hello World!"
range.Font.Name = "Arial"
range.Font.Size = 48
range.Font.Italic = True
range.Font.Color = Color.Red
range.ParagraphFormat.SpaceBefore = 24
range.ParagraphFormat.Alignment = ParagraphAlignment.Center
range.ParagraphFormat.SpaceAfter = 24
doc.Save(MyPath & "ExRange.HelloWorld Out.xml")
Members
| Member Name | Description | Value |
| Left | Text is aligned to the left. | 0 |
| Center | Text is centered horizontally. | 1 |
| Right | Text is aligned to the right. | 2 |
| Justify | Text is aligned to both left and right. | 3 |
| Distributed | Text is evenly distributed. | 4 |
Requirements
Namespace: Aspose.Editor.Desktop
Assembly: Aspose.Editor.Desktop (in Aspose.Editor.Desktop.dll)
See Also
Aspose.Editor.Desktop Namespace | ParagraphFormat