TX Text Control .NET for WPF

Width Property

Property|Introduced in 16.0
Namespace
TXTextControl
Package
TXTextControl.TextControl.WPF.SDK as TXTextControl.dll from the private NuGet feed or Text Control Offline Packages

Description

Specifies the page width of a document or document section. The measure depends on the TextControl.PageUnit, WPF.TextControl.PageUnit or ServerTextControl.PageUnit property.

Syntax

public double Width { get; set; }

Examples

The following example configures page size for the current document by using PageSize.Width.

PageSize pageSize = textControl.PageSize;

pageSize.Width = 1.0;
Console.WriteLine($"Width used by Page Size: {pageSize.Width}");

pageSize.Width = 12240;
pageSize.Height = 15840;

Limitations

The maximum value depends on the capabilities of the selected printer and must not exceed 22.75 inch.

Remarks

The width's default value is 8.5 inch.

The property returns its default value when the text selection contains multiple sections with mixed page widths. The Selection.IsCommonValueSelected method can be used to check for mixed attributes.

Further Reading

  • MeasureString for Text in TextControl –
  • 'Fit to Page' and 'Fit to Width' Using TX Text Control .NET –
  • Inserting Columns Programmatically Using TX Text Control .NET –
  • Landscape Printing with a PrintDocument –