# PageBorder Class

> 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.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Class
- **Introduced:** 17.0
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.Core.SDK` (assembly `TXTextControl.Core.dll`, from the private NuGet feed or Text Control Offline Packages)
- **Package:** `TXTextControl.TextControl.ASP.SDK` (assembly `TXTextControl.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.dll` from the setup
- **Path:** TX Text Control .NET Server > Reference > TXTextControl > PageBorder Class
- **1696 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/pageborder/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/pageborder/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/pageborder/llms-full.txt

---

### 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

```csharp
public class PageBorder
```

```vbnet
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.

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

```vbnet
Dim pageBorder As PageBorder = textControl.Sections(1).Format.PageBorder
Console.WriteLine("Page Border is ready for use.")
```

---

## In This Section

- [PageBorder.Attribute Enumeration](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/pageborder/attribute-enumeration/llms-full.txt): Determines a certain page border attribute. This enumeration is used with the Selection.IsCommonValueSelected method. It contains the following values:
- [PageBorder.BottomDistance Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/pageborder/bottomdistance-property/llms-full.txt): Gets 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.
- [PageBorder.BottomLineColor Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/pageborder/bottomlinecolor-property/llms-full.txt): Gets or sets the color of the bottom border line.
- [PageBorder.BottomLineWidth Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/pageborder/bottomlinewidth-property/llms-full.txt): Gets 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.
- [PageBorder Constructor](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/pageborder/constructor/llms-full.txt): Creates a new instance of the PageBorder class.
- [PageBorder.DefaultDistance Field](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/pageborder/defaultdistance-field/llms-full.txt): Represents the default distance of a page border from the edge of the page. The value of this constant is 454 twips = 8 mm.
- [PageBorder.FirstPageOnly Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/pageborder/firstpageonly-property/llms-full.txt): Gets 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.
- [PageBorder.LeftDistance Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/pageborder/leftdistance-property/llms-full.txt): Gets 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.
- [PageBorder.LeftLineColor Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/pageborder/leftlinecolor-property/llms-full.txt): Gets or sets the color of the left border line.
- [PageBorder.LeftLineWidth Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/pageborder/leftlinewidth-property/llms-full.txt): Gets 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.
- [PageBorder.MeasureFromText Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/pageborder/measurefromtext-property/llms-full.txt): Gets 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.
- [PageBorder.OmitFirstPage Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/pageborder/omitfirstpage-property/llms-full.txt): Gets 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.
- [PageBorder.RightDistance Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/pageborder/rightdistance-property/llms-full.txt): Gets 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.
- [PageBorder.RightLineColor Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/pageborder/rightlinecolor-property/llms-full.txt): Gets or sets the color of the right border line.
- [PageBorder.RightLineWidth Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/pageborder/rightlinewidth-property/llms-full.txt): Gets 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.
- [PageBorder.SurroundFooter Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/pageborder/surroundfooter-property/llms-full.txt): Gets 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.
- [PageBorder.SurroundHeader Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/pageborder/surroundheader-property/llms-full.txt): Gets 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.
- [PageBorder.TopDistance Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/pageborder/topdistance-property/llms-full.txt): Gets 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.
- [PageBorder.TopLineColor Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/pageborder/toplinecolor-property/llms-full.txt): Gets or sets the color of the top border line.
- [PageBorder.TopLineWidth Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/pageborder/toplinewidth-property/llms-full.txt): Gets 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.

---

## Nearby

- **Previous:** [Page.TextBounds Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/page/textbounds-property/llms-full.txt)
- **Next:** [PageBorder.Attribute Enumeration](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/pageborder/attribute-enumeration/llms-full.txt)
