# Customizing the Print Job Settings

Learn how to customize print job settings in Windows environment and set printer, paper source, and paper size using code examples in C# and VB.

## Content

Sheets are printed on the current default printer in your Windows environment unless you specify otherwise. You can print sheets on any Windows-supported printer.
The print job settings that you can customize include printer, source, page size and collated settings. Set the [Printer](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.PrintInfo.Printer.html), [PaperSource](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.PrintInfo.PaperSource.html), or [PaperSize](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.PrintInfo.PaperSize.html) on the **PrintInfo** object and Collated settings on the PageSetup object.
**Using Code**

1. Set various print job settings.
2. Print the sheet.

**Example**
This example code sets the paper source based on a selection from a combo box and sets the paper size before printing all the sheets.

```csharp
private void Form1_Load(object sender, System.EventArgs e)
{
    int i;
    System.Drawing.Printing.PrinterSettings ps = new System.Drawing.Printing.PrinterSettings();
    
    for (i = 0; i <= ps.PaperSources.Count - 1; i++)
    {
        comboBox1.Items.Add(ps.PaperSources[i].SourceName);
    }
    comboBox1.Text = ps.PaperSources[0].SourceName;
}

private void button1_Click(object sender, System.EventArgs e
{
    FarPoint.Win.Spread.PrintInfo pi = new FarPoint.Win.Spread.PrintInfo();
    System.Drawing.Printing.PrinterSettings ps = new System.Drawing.Printing.PrinterSettings();
    pi.PaperSize = new System.Drawing.Printing.PaperSize("Letter", 600, 300);
    pi.PaperSource = ps.PaperSources[comboBox1.SelectedIndex];
    fpSpread1.Sheets[0].PrintInfo = pi;
    fpSpread1.PrintSheet(-1);
}
```

```vbnet
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim ps As New System.Drawing.Printing.PrinterSettings()
    Dim i As Integer
    For i = 0 To ps.PaperSources.Count - 1
        ComboBox1.Items.Add(ps.PaperSources.Item(i).SourceName)
    Next
    ComboBox1.Text = ps.PaperSources.Item(0).SourceName
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    Dim pi As New FarPoint.Win.Spread.PrintInfo()
    Dim ps As New System.Drawing.Printing.PrinterSettings()
    pi.PaperSize = New System.Drawing.Printing.PaperSize("Letter", 600, 300)
    pi.PaperSource = ps.PaperSources(ComboBox1.SelectedIndex)
    FpSpread1.Sheets(0).PrintInfo = pi
    FpSpread1.PrintSheet(-1)
End Sub
```

## Set the Collated Printing

In printing, the term **Collated** refers to printing the first copy in the same order from start to finish, followed by printing the next copy in the same order, whereas **Uncollated** refers to printing multiple copies of the first page of a document, then multiple copies of the second page, and so on.
In Spread.NET, the **Collated** property when set as true uses **IPageSetup** object to implement the collated printing of the spreadsheet.
The following image shows the Collated option in the Print settings that appears on your screen.
![](https://cdn.mescius.io/document-site-files/images/2238e618-a1fb-45a6-9ce5-9a4157bd2931/images/collated.png)
**Example**
Collated printing can be useful for creating employee training materials whereas Uncollated option can be useful for creating separate piles of each page from the document.
Refer to the following code to implement an uncollected printing of the Spreadsheet.

```csharp
IWorksheet TestActiveSheet = fpSpread1.AsWorkbook().ActiveSheet;
for (int i = 1; i < 50; i++)
{
  for (int j = 3; j < 10; j++)
  {
   TestActiveSheet.Cells[i, j].Value = i + j;
  }
}
GrapeCity.Spreadsheet.Printing.IPageSetup pageSetup = fpSpread1.AsWorkbook().ActiveSheet.PageSetup;
pageSetup.Collated = false;
pageSetup.NumberOfCopies = 3;
fpSpread1.Sheets[0].PrintInfo.Preview = true;
fpSpread1.Sheets[0].PrintInfo.EnhancePreview = true;
fpSpread1.PrintSheet(0);
```

```vbnet
Dim TestActiveSheet As IWorksheet = fpSpread1.AsWorkbook().ActiveSheet
For i = 1 To 49
  For j = 3 To 9
     TestActiveSheet.Cells(i, j).Value = i + j
  Next
Next
Dim pageSetup As GrapeCity.Spreadsheet.Printing.IPageSetup = fpSpread1.AsWorkbook().ActiveSheet.PageSetup
pageSetup.Collated = False
pageSetup.NumberOfCopies = 3
FpSpread1.Sheets(0).PrintInfo.Preview = True
FpSpread1.Sheets(0).PrintInfo.EnhancePreview = True
FpSpread1.PrintSheet(0)
```

> !type=note
> **Note:** The Collated/Uncollated option cannot be used for printing PDFs, as NumberOfCopies property is not applicable for PDF.

## See Also

[Understanding the Printing Options](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-printing/spwin-printcustomize/spwin-printoptions)
[Customizing the Printed Page Layout](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-printing/spwin-printcustomize/spwin-printlayout)
[Customizing the Printed Page Header or Footer](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-printing/spwin-printcustomize/spwin-printheadfoot)
[Customizing the Print Preview Dialog](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-printing/spwin-printcustomize/CustomizingthePrintPreviewDialog)
[Repeating Rows or Columns on Printed Pages](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-printing/spwin-printcustomize/spwin-printrepeatrange)
[Adding a Page Break](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-printing/spwin-printcustomize/spwin-pagebreaks)
[Adding a Watermark to a Printed Page](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-printing/spwin-printcustomize/spwin-printwatermark)