PaperSize Class
- Namespace
TXTextControl
- Package
TXTextControl.from the private NuGet feed or Text Control Offline PackagesTextControl. WPF. SDK
- Assembly
TXTextControl.dll
- Install
dotnet add package TXTextControl..NET 8 and later. For .NET Framework, referenceTextControl. WPF. SDK TXTextControl.from the setup.dll
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 PaperSizePublic Class PaperSizeExamples
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}");Dim paperSize As PaperSize = textControl.GetSupportedPaperSizes().
First(Function(size) size.Name.IndexOf("A4", StringComparison.OrdinalIgnoreCase) >= 0)
Console.WriteLine($"Using paper size: {paperSize.Name}")Members
Properties
| Property | Description |
|---|---|
| Height | 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. |
| Name | Gets the name of the paper size. |
| Width | 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. |