# PageMargins Class

> An instance of the PageMargins class represents the page margins of a TX Text Control document or document section. The measure depends on the TextControl.PageUnit, WPF.TextControl.PageUnit or ServerTextControl.PageUnit property.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Class
- **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 > PageMargins Class
- **1099 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/pagemargins/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/pagemargins/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/pagemargins/llms-full.txt

---

### Description

An instance of the PageMargins class represents the page margins of a TX Text Control document or document section. The measure depends on the [TextControl.PageUnit](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/pageunit-property/llms-full.txt), [WPF.TextControl.PageUnit](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/pageunit-property/llms-full.txt) or [ServerTextControl.PageUnit](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/servertextcontrol/pageunit-property/llms-full.txt) property.

### Syntax

```csharp
public class PageMargins
```

```vbnet
Public Class PageMargins
```

### Examples

The following example shows how to set the page margins for the current section.

```csharp
TXTextControl.Section section = textControl1.Sections.GetItem();
TXTextControl.PageMargins margins =
    new TXTextControl.PageMargins(200, 100, 200, 100);

section.Format.PageMargins = margins;
```

```vbnet
Dim section As TXTextControl.Section = TextControl1.Sections.GetItem()
Dim margins As TXTextControl.PageMargins = _
    New TXTextControl.PageMargins(200, 100, 200, 100)

section.Format.PageMargins = margins
```

The following example configures page margins for the current document.

```csharp
PageMargins pageMargins = textControl.PageMargins;
pageMargins.Left = 1440;
pageMargins.Right = 1440;
```

```vbnet
Dim pageMargins As PageMargins = textControl.PageMargins
pageMargins.Left = 1440
pageMargins.Right = 1440
```

---

## In This Section

- [PageMargins.Attribute Enumeration](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/pagemargins/attribute-enumeration/llms-full.txt): Determines a certain attribute. This enumeration is used with the Selection.IsCommonValueSelected method.
- [PageMargins.Bottom Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/pagemargins/bottom-property/llms-full.txt): Specifies the bottom margin of a TX Text Control document or document section. The measure depends on the TextControl.PageUnit, WPF.TextControl.PageUnit or ServerTextControl.PageUnit property.
- [PageMargins Constructor](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/pagemargins/constructor/llms-full.txt): Creates a new instance of the PageMargins class.
- [PageMargins.Left Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/pagemargins/left-property/llms-full.txt): Specifies the left margin of a TX Text Control document or document section. The measure depends on the TextControl.PageUnit, WPF.TextControl.PageUnit or ServerTextControl.PageUnit property.
- [PageMargins.Right Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/pagemargins/right-property/llms-full.txt): Specifies the right margin of a TX Text Control document or document section. The measure depends on the TextControl.PageUnit, WPF.TextControl.PageUnit or ServerTextControl.PageUnit property.
- [PageMargins.Top Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/pagemargins/top-property/llms-full.txt): Specifies the top margin of a TX Text Control document or document section. The measure depends on the TextControl.PageUnit, WPF.TextControl.PageUnit or ServerTextControl.PageUnit property.

---

## Nearby

- **Previous:** [PageContent Enumeration](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/pagecontent/enumeration/llms-full.txt)
- **Next:** [PageMargins.Attribute Enumeration](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/pagemargins/attribute-enumeration/llms-full.txt)
