PrinterSettings.FromPage Property

Definition

Gets or sets the page number of the first page to print.

C#
public int FromPage { get; set; }

Property Value

The page number of the first page to print.

Exceptions

The FromPage property's value is less than zero.

Remarks

The FromPage and ToPage properties are used by the PrintDialog when the user selects a print range. The PrintDialog.AllowSomePages property must be set to true to enable the user to specify a print range. In addition, the PrintDialog requires the MinimumPage and MaximumPage to be specified and the FromPage value to be within that range.

During the printing process, in the PrintDocument.PrintPage event, view the PrintRange to determine what should be printed. If PrintRange is PrintRange.SomePages, use the FromPage and ToPage properties to determine what pages should be printed. If PrintRange is PrintRange.Selection, then specify output only for the selected pages.

The FromPage, ToPage and PrintRange can also be set programmatically, though the PrintDocument.PrintPage implementation is the same.

Applies to

Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

See also