TextColumn Class |
Namespace: Aspose.Words
The TextColumn type exposes the following members.
Name | Description | |
---|---|---|
![]() ![]() | SpaceAfter |
Gets or sets the space between this column and the next column in points. Not required for the last column.
|
![]() ![]() | Width |
Gets or sets the width of the text column in points.
|
Name | Description | |
---|---|---|
![]() | Equals | (Inherited from Object.) |
![]() | GetHashCode | (Inherited from Object.) |
![]() | GetType | (Inherited from Object.) |
![]() | ToString | (Inherited from Object.) |
TextColumn objects are only used to specify columns with custom width and spacing. If you want the columns in the document to be of equal width, set TextColumns.EvenlySpaced to true.
When a new TextColumn is created it has its width and spacing set to zero.
DocumentBuilder builder = new DocumentBuilder(); TextColumnCollection columns = builder.PageSetup.TextColumns; // Show vertical line between columns columns.LineBetween = true; // Indicate we want to create column with different widths columns.EvenlySpaced = false; // Create two columns, note they will be created with zero widths, need to set them columns.SetCount(2); // Set the first column to be narrow TextColumn c1 = columns[0]; c1.Width = 100; c1.SpaceAfter = 20; // Set the second column to take the rest of the space available on the page TextColumn c2 = columns[1]; PageSetup ps = builder.PageSetup; double contentWidth = ps.PageWidth - ps.LeftMargin - ps.RightMargin; c2.Width = contentWidth - c1.Width - c1.SpaceAfter; builder.Writeln("Narrow column 1."); builder.InsertBreak(BreakType.ColumnBreak); builder.Writeln("Wide column 2."); builder.Document.Save(ArtifactsDir + "PageSetup.CustomColumnWidth.doc");