TX Text Control .NET for Windows Forms

PaperSize Class

Class|Introduced in 24.0
Namespace
TXTextControl
Package
TXTextControl.TextControl.WinForms.SDK from the private NuGet feed or Text Control Offline Packages
Assembly
TXTextControl.dll
Install
dotnet add package TXTextControl.TextControl.WinForms.SDK .NET 8 and later. For .NET Framework, reference TXTextControl.dll from the setup.

Description

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.

Syntax

public class PaperSize

Examples

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

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

Members

Properties

PropertyDescription
HeightGets 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.
NameGets the name of the paper size.
WidthGets 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.