# Printing Particular Pages

Learn how to print specific pages in Spread.NET using PrintType, PageStart, and PageEnd properties.

## Content

You can print all or some of the pages for the sheet. Specify the pages to print by setting the [PrintType](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.PrintInfo.PrintType.html), [PageStart](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.PrintInfo.PageStart.html), and [PageEnd](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.PrintInfo.PageEnd.html) properties of the [PrintInfo](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.PrintInfo.html) object.
You can calculate the number of printed pages for the sheet using the [GetPrintPageCount](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.FpSpread.GetPrintPageCount.html) method.

## Using the Properties Window

1. At design time, in the **Properties** window, select the Spread component.
2. Select the **Sheets** property.
3. Click the button to display the **SheetView Collection Editor**.
4. In the **Members** list, select the sheet for which to set the print the page range.
5. In the properties list, double-click the **PrintInfo** property to display the settings for the **PrintInfo** class.
6. Set the **PrintType** property to **PageRange**.
7. Set the **PageStart** and **PageEnd** properties to designate the page range to print.
8. Click **OK** to close the editor.

## Using a Shortcut

1. Create a [PrintInfo](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.PrintInfo.html) object.
2. Set the [PrintInfo](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.PrintInfo.html) object [PrintType](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.PrintInfo.PrintType.html) property to PrintType.PageRange.
<br>
    If you just want to print the current page, set the [PrintType](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.PrintInfo.PrintType.html) property to PrintType.CurrentPage, and go on to step 4.
3. Set the PrintInfo object [PageStart](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.PrintInfo.PageStart.html) and [PageEnd](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.PrintInfo.PageEnd.html) properties to designate the page range to print.
4. Set the Sheet shortcut object **PrintInfo** property to the PrintInfo object you just created.

**Example**
This example code prints pages 5 through 10.

```csharp
// Create PrintInfo object and set properties.
FarPoint.Win.Spread.PrintInfo printset = new FarPoint.Win.Spread.PrintInfo();
printset.PrintType = FarPoint.Win.Spread.PrintType.PageRange;
printset.PageStart = 5;
printset.PageEnd = 10;
// Set the PrintInfo property for the first sheet.
fpSpread1.Sheets[0].PrintInfo = printset;
// Print the sheet.
fpSpread1.PrintSheet(0);
```

```vbnet
' Create PrintInfo object and set properties.
Dim printset As New FarPoint.Win.Spread.PrintInfo()
printset.PrintType = FarPoint.Win.Spread.PrintType.PageRange
printset.PageStart = 5
printset.PageEnd = 10
' Set the PrintInfo property for the first sheet.
fpSpread1.Sheets(0).PrintInfo = printset
' Print the sheet.
fpSpread1.PrintSheet(0)
```

**Using Code**

1. Create a [PrintInfo](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.PrintInfo.html) object.
2. Set the [PrintInfo](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.PrintInfo.html) object [PrintType](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.PrintInfo.PrintType.html) property to PrintType.PageRange.
<br>
    If you just want to print the current page, set the [PrintType](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.PrintInfo.PrintType.html) property to PrintType.CurrentPage, and go on to step 4.
3. Set the PrintInfo object [PageStart](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.PrintInfo.PageStart.html) and [PageEnd](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.PrintInfo.PageEnd.html) properties to designate the page range to print.
4. Set the SheetView object **PrintInfo** property to the PrintInfo object you just created.

**Example**
This example code prints pages 5 through 10.

```csharp
// Create PrintInfo object and set properties.
FarPoint.Win.Spread.PrintInfo printset = new FarPoint.Win.Spread.PrintInfo();
printset.PrintType = FarPoint.Win.Spread.PrintType.PageRange;
printset.PageStart = 5;
printset.PageEnd = 10;
// Create SheetView object and assign it to the first sheet.
FarPoint.Win.Spread.SheetView SheetToPrint = new FarPoint.Win.Spread.SheetView();
SheetToPrint.PrintInfo = printset;
fpSpread1.Sheets[0] = SheetToPrint;
// Print the sheet.
fpSpread1.PrintSheet(0);
```

```vbnet
' Create PrintInfo object and set properties.
Dim printset As New FarPoint.Win.Spread.PrintInfo()
printset.PrintType = FarPoint.Win.Spread.PrintType.PageRange
printset.PageStart = 5
printset.PageEnd = 10
' Create SheetView object and assign it to the first sheet.
Dim SheetToPrint As New FarPoint.Win.Spread.SheetView()
SheetToPrint.PrintInfo = printset
fpSpread1.Sheets(0) = SheetToPrint
' Set the PrintInfo property for the first sheet.
fpSpread1.Sheets(0).PrintInfo = printset
' Print the sheet.
fpSpread1.PrintSheet(0)
```

## Using the Spread Designer

1. Select the sheet tab for the sheet you want to print.
2. From the **Property** window, choose **PrintInfo**.
3. Set **Print Type** to **PageRange**.
4. Set **PageEnd** and **PageStart**.
5. From the **File** menu choose **Apply and Exit** to apply your changes to the component and exit Spread Designer.

## See Also

[Printing an Entire Sheet](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-printing/spwin-printactions/spwin-printsheet)
[Printing to PDF](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-printing/spwin-printactions/spwin-printPDF)
[Printing a Child View of a Hierarchical Display](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-printing/spwin-printactions/spwin-printhierarchy)
[Printing the Portion of the Sheet with Data](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-printing/spwin-printactions/spwin-printdataarea)
[Printing a Range of Cells on a Sheet](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-printing/spwin-printactions/spwin-printrange)
[Printing an Area of the Sheet](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-printing/spwin-printactions/spwin-printarea)
[Printing a Sheet with Cell Notes](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-printing/spwin-printactions/spwin-printnotes)
[Printing a Sheet with Shapes](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-printing/spwin-printactions/spwin-printshapes)
[Printing in Duplex Mode](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-printing/spwin-printactions/PrintingDuplexMode)