TX Text Control .NET for WPF

SectionFormat Class

Class|Introduced in 14.0
Namespace
TXTextControl
Package
TXTextControl.TextControl.WPF.SDK from the private NuGet feed or Text Control Offline Packages
Assembly
TXTextControl.dll
Install
dotnet add package TXTextControl.TextControl.WPF.SDK .NET 8 and later. For .NET Framework, reference TXTextControl.dll from the setup.

Description

An instance of the SectionFormat class represents the formatting attributes of a section.

Syntax

public class SectionFormat

Examples

The following example shows how to add a new section with a specific page size, orientation and margins into an existing document. Additionally, the section is devided into 3 columns with different column widths and column distances:

TXTextControl.SectionFormat sf = new TXTextControl.SectionFormat(3, new int[] { 1500, 2500, 5000 }, new int[] { 250, 500 });
sf.ColumnLineColor = Color.Black;
sf.ColumnLineWidth = 50;
sf.PageSize = new Size(500, 1000);
sf.Landscape = true;
sf.PageMargins = new TXTextControl.PageMargins(100, 100, 100, 100);
textControl1.Sections.Add(TXTextControl.SectionBreakKind.BeginAtNewPage);
textControl1.Sections.GetItem().Format = sf;

The following example configures the layout of the first document section. The created object is then available to the surrounding document workflow.

SectionFormat sectionFormat = textControl.Sections[1].Format;
Console.WriteLine("Section Format is ready for use.");

Members

Constructors

ConstructorDescription
SectionFormatCreates a new instance of the SectionFormat class.

Properties

PropertyDescription
BreakKindGets or sets the kind of the section break the section starts with. The property's value is a member of the SectionBreakKind enumeration.
ColumnDistancesGets the distances, in twips, between the columns on a page. This property is read only, to set new distances one of the SectionFormat constructors must be used.
ColumnLineColorGets or sets the color of a dividing line between two columns.
ColumnLineWidthGets or sets the width of a dividing line between two columns. If this property's value is zero there is no dividing line. Otherwise it is a value in twips.
ColumnsGets or sets the number of columns on a page.
ColumnWidthsGets the widths, in twips, of the columns on a page. This property is read only, to set new widths one of the SectionFormat constructors must be used.
EqualColumnWidthGets or sets a value indicating whether the columns on a page have all the same width and the same distance between them. If this property is set to true, the width of the columns are automatically calculated from the page size. The common distance can be specified with the SectionFormat.ColumnDistances property.
LandscapeGets or sets a value indicating whether the section's page size is in landscape orientation.
PageBorderGets or sets the attributes of a section's page border. The property's value is an object of the type PageBorder.
PageMarginsGets or sets the section's page margins. The property's value is an object of the type PageMargins.
PageSizeGets or sets the section's page size. The width and height are always the values in portrait orientation.
RestartPageNumberingGets or sets a value indicating whether page numbering is restarted at the section's beginning. The starting number is determined through the PageNumberField.StartNumber property.

Enumerations

EnumerationDescription
AttributeDetermines a certain section format attribute. This enumeration is used with the Selection.IsCommonValueSelected method. It contains the following values: