TX Text Control .NET for WPF

PageBorder Class

Class|Introduced in 17.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 PageBorder class represents the attributes of a border, which is drawn in the margin area of a page. A page border can have a top, left, right or bottom line or a combination of these lines. The line width and the color can be defined for each line separately. For each line a distance can be specified, which is either a distance to the edge of the page or to the text. The page border can surround the text including page headers and footers or only the text of the page. The border can be defined for the first page, for all pages or beginning with the second page.

Syntax

public class PageBorder

Examples

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

PageBorder pageBorder = textControl.Sections[1].Format.PageBorder;
Console.WriteLine("Page Border is ready for use.");

Members

Constructors

ConstructorDescription
PageBorderCreates a new instance of the PageBorder class.

Properties

PropertyDescription
BottomDistanceGets or sets the distance, in twips, of the bottom border line either from the edge of the page or from the text, depending on the MeasureFromText property.
BottomLineColorGets or sets the color of the bottom border line.
BottomLineWidthGets or sets the width of the bottom border line. If this property's value is zero there is no bottom border line. Otherwise it is a value in twips.
FirstPageOnlyGets or sets a value indicating whether the page border is drawn only on the first page of the section. If this property is set to true, the page border is drawn only on the first page, otherwise it is drawn on all pages of the section.
LeftDistanceGets or sets the distance, in twips, of the left border line either from the edge of the page or from the text, depending on the MeasureFromText property.
LeftLineColorGets or sets the color of the left border line.
LeftLineWidthGets or sets the width of the left border line. If this property's value is zero, there is no left border line. Otherwise it is a value in twips.
MeasureFromTextGets or sets a value indicating whether the page border's distances are measured from the text. If this property is set to true, the page border's distances are measured from the text, otherwise they are measured from the edge of the page.
OmitFirstPageGets or sets a value indicating whether the page border is not drawn on the first page of the section. If this property is set to true, the page border is not drawn on the first page but on all other pages, otherwise it is drawn on all pages of the section.
RightDistanceGets or sets the distance, in twips, of the right border line either from the edge of the page or from the text, depending on the MeasureFromText property.
RightLineColorGets or sets the color of the right border line.
RightLineWidthGets or sets the width of the right border line. If this property's value is zero there is no right border line. Otherwise it is a value in twips.
SurroundFooterGets or sets a value indicating whether the page border surrounds the section's footer. If this property is set to true, the page border surrounds the footer, otherwise it surrounds only the text. This property only has a meaning, if the MeasureFromText property has been set to true.
SurroundHeaderGets or sets a value indicating whether the page border surrounds the section's header. If this property is set to true, the page border surrounds the header, otherwise it surrounds only the text. This property only has a meaning, if the MeasureFromText property has been set to true.
TopDistanceGets or sets the distance, in twips, of the top border line either from the edge of the page or from the text, depending on the MeasureFromText property.
TopLineColorGets or sets the color of the top border line.
TopLineWidthGets or sets the width of the top border line. If this property's value is zero there is no top border line. Otherwise it is a value in twips.

Fields

FieldDescription
DefaultDistanceRepresents the default distance of a page border from the edge of the page. The value of this constant is 454 twips = 8 mm.

Enumerations

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