# Configure Paper Source

DsExcel allows you to configure the paper source while printing a PDF document. Learn more in DsExcel docs.

## Content

DsExcel allows you to configure the paper source while printing a PDF document. It lets you control whether the PDF page size should be used to select the input paper tray while printing. This can be done by using the **PickTrayByPDFSize** property of the **ViewerPreferences** class.
Refer to the following example code to configure paper source while printing a PDF document.

```csharp
// Initialize workbook
Workbook workbook = new Workbook();

// Fetch default worksheet
IWorksheet worksheet = workbook.Worksheets[0];

worksheet.Range["A1"].Value = "Document Solutions for Excel";
worksheet.Range["A1"].Font.Size = 25;

// create a pdfSaveOptions object before using ViewerPreferences
PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();

// PDF page size is used to select the input paper tray when printing
pdfSaveOptions.ViewerPreferences.PickTrayByPDFSize = true;

// Save the workbook into pdf file
workbook.Save("PickTrayByPDFSize.pdf", pdfSaveOptions);
```

The paper source setting appears in the 'Print' dialog box of PDF document as shown below:
![pdftraysize](https://cdn.mescius.io/document-site-files/images/9ef1b0ea-3f00-48ea-ad80-9af150dddb0b/pdftraysize.c7d2bb.png)