# TextControl.PageMargins Property

> Gets or sets the margins for the pages of the current document. The measure depends on the WPF.TextControl.PageUnit property. The default measure is device-independent units (1/96th inch). The property value is an object of the type PageMargins. For more information see the description of the PageMargins class.

- **Product:** TX Text Control .NET for WPF
- **Section:** Reference
- **Kind:** Property
- **Introduced:** 16.0
- **Namespace:** `TXTextControl.WPF`
- **Package:** `TXTextControl.TextControl.WPF.SDK` (assembly `TXTextControl.WPF.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.WPF.dll` from the setup
- **Path:** TX Text Control .NET for WPF > Reference > TXTextControl.WPF > TextControl.PageMargins Property
- **449 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/pagemargins-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/pagemargins-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/pagemargins-property/llms-full.txt

---

### Description

Gets or sets the margins for the pages of the current document. The measure depends on the [WPF.TextControl.PageUnit](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/pageunit-property/llms-full.txt) property. The default measure is device-independent units (1/96th inch). The property value is an object of the type [PageMargins](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/pagemargins/llms-full.txt). For more information see the description of the PageMargins class.

### Syntax

```csharp
public PageMargins PageMargins { get; set; }
```

```vbnet
Public Property PageMargins As PageMargins
```

### Examples

The following example uses `TextControl.PageMargins` to apply the required margins to exported pages. The configured value is checked before the workflow continues.

```csharp
textControl.PageMargins = new PageMargins();
if (textControl.PageMargins != null)
{
    Console.WriteLine("Text Control: Page Margins is available.");
}
```

```vbnet
textControl.PageMargins = New PageMargins()
If textControl.PageMargins IsNot Nothing Then
    Console.WriteLine("Text Control: Page Margins is available.")
End If
```

---

## Nearby

- **Previous:** [TextControl.PageFormatChanged Event](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/pageformatchanged-event/llms-full.txt)
- **Next:** [TextControl.Pages Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/pages-property/llms-full.txt)
