# PaperSize Class

> The PaperSize class is used with the TextControl.GetSupportedPaperSizes and WPF.TextControl.GetSupportedPaperSizes methods, which return the names and the sizes of all currently supported paper sizes. These paper sizes depend on the formatting device set with the TextControl.FormattingPrinter or WPF.TextControl.FormattingPrinter property.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Class
- **Introduced:** 24.0
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.WinForms.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 for Windows Forms > Reference > TXTextControl > PaperSize Class
- **720 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/papersize/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/papersize/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/papersize/llms-full.txt

---

### Description

The PaperSize class is used with the [TextControl.GetSupportedPaperSizes](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/getsupportedpapersizes-method/llms-full.txt) and [WPF.TextControl.GetSupportedPaperSizes](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/getsupportedpapersizes-method/llms-full.txt) methods, which return the names and the sizes of all currently supported paper sizes. These paper sizes depend on the formatting device set with the [TextControl.FormattingPrinter](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/formattingprinter-property/llms-full.txt) or [WPF.TextControl.FormattingPrinter](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/formattingprinter-property/llms-full.txt) property.

### Syntax

```csharp
public class PaperSize
```

```vbnet
Public Class PaperSize
```

### Examples

The following example selects the supported A4 paper definition by name.

```csharp
PaperSize paperSize = textControl.GetSupportedPaperSizes()
    .First(size => size.Name.Contains("A4", StringComparison.OrdinalIgnoreCase));
Console.WriteLine($"Using paper size: {paperSize.Name}");
```

```vbnet
Dim paperSize As PaperSize = textControl.GetSupportedPaperSizes().
    First(Function(size) size.Name.IndexOf("A4", StringComparison.OrdinalIgnoreCase) >= 0)
Console.WriteLine($"Using paper size: {paperSize.Name}")
```

---

## In This Section

- [PaperSize.Height Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/papersize/height-property/llms-full.txt): Gets the height of the paper size, in twips. The value of this property is the height (y-dimension) of the paper size as if the paper were in the portrait orientation.
- [PaperSize.Name Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/papersize/name-property/llms-full.txt): Gets the name of the paper size.
- [PaperSize.Width Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/papersize/width-property/llms-full.txt): Gets the width of the paper size, in twips. The value of this property is the width (x-dimension) of the paper size as if the paper were in the portrait orientation.

---

## Nearby

- **Previous:** [PageSize.Width Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/pagesize/width-property/llms-full.txt)
- **Next:** [PaperSize.Height Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/papersize/height-property/llms-full.txt)
