# Printing to PDF

Learn how to print a sheet to a PDF file using the PrintToPdf method in the PrintInfo class with customizable print settings.

## Content

You can print a sheet to a Portable Document Format (PDF, version 1.4) file using the [PrintToPdf](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.PrintInfo.PrintToPdf.html) method in the [PrintInfo](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.PrintInfo.html) class. Use the [PdfFileName](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.PrintInfo.PdfFileName.html) property to specify the file name and location to which to save the file. Since **PrintInfo** objects are assigned to individual sheets, this method prints an individual sheet.
You can set a password with the [PdfSecurity](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.PrintInfo.PdfSecurity.html) property.
The following cell type items are not printed to PDF:

| **Cell Type** | **Description** |
| --------- | ----------- |
| [GcTextBoxCellType](/spreadnet/api/latest/online-win/GrapeCity.Win.PluginInputMan/GrapeCity.Win.Spread.InputMan.CellType.GcTextBoxCellType.html) | [LineSpace](/spreadnet/api/latest/online-win/GrapeCity.Win.PluginInputMan/GrapeCity.Win.Spread.InputMan.CellType.GcTextBoxCellType.LineSpace.html), [Ellipsis](/spreadnet/api/latest/online-win/GrapeCity.Win.PluginInputMan/GrapeCity.Win.Spread.InputMan.CellType.GcTextBoxCellType.Ellipsis.html), or [DisplayAlignment](/spreadnet/api/latest/online-win/GrapeCity.Win.PluginInputMan/GrapeCity.Win.Spread.InputMan.CellType.GcTextBoxCellType.DisplayAlignment.html) |
| Any Gc cell type | Side button appearance |
| [GcDateTimeCellType](/spreadnet/api/latest/online-win/GrapeCity.Win.PluginInputMan/GrapeCity.Win.Spread.InputMan.CellType.GcDateTimeCellType.html) | Field appearance |
| [GcNumberCellType](/spreadnet/api/latest/online-win/GrapeCity.Win.PluginInputMan/GrapeCity.Win.Spread.InputMan.CellType.GcNumberCellType.html) | Field appearance |
| [GcTimeSpanCellType](/spreadnet/api/latest/online-win/GrapeCity.Win.PluginInputMan/GrapeCity.Win.Spread.InputMan.CellType.GcTimeSpanCellType.html) | Field appearance |
| [GcMaskCellType](/spreadnet/api/latest/online-win/GrapeCity.Win.PluginInputMan/GrapeCity.Win.Spread.InputMan.CellType.GcMaskCellType.html) | Field appearance |
| [GcCharMaskCellType](/spreadnet/api/latest/online-win/GrapeCity.Win.PluginInputMan/GrapeCity.Win.Spread.InputMan.CellType.GcCharMaskCellType.html) | Character box appearance |
| [GcComboBoxCellType](/spreadnet/api/latest/online-win/GrapeCity.Win.PluginInputMan/GrapeCity.Win.Spread.InputMan.CellType.GcComboBoxCellType.html) | Image appearance or ellipsis |

To customize print settings, refer to [Understanding the Printing Options](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-printing/spwin-printcustomize/spwin-printoptions) and [Customizing the Printed Page Header or Footer](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-printing/spwin-printcustomize/spwin-printheadfoot). To allow Spread to determine the best print settings, refer to [Optimizing the Printing Using Rules](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-printing/spwin-printoptimize/spwin-printsmart).

## Using Code

Call the [PrintToPdf](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.PrintInfo.PrintToPdf.html) property in the [PrintInfo](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.PrintInfo.html) class to print the specified sheet.

## Example

This example code saves the sheet to a PDF file.

```csharp
FarPoint.Win.Spread.PrintInfo printset = new FarPoint.Win.Spread.PrintInfo();
printset.PrintToPdf = true;
printset.PdfFileName = "D:\\results.pdf";
// Assign the printer settings and print
fpSpread1.Sheets[0].PrintInfo = printset;
fpSpread1.PrintSheet(0);
```

```vbnet
Dim printset As New FarPoint.Win.Spread.PrintInfo()
printset.PrintToPdf = True
printset.PdfFileName = "D:\results.pdf"
' Assign the printer settings and print
fpSpread1.Sheets(0).PrintInfo = printset
fpSpread1.PrintSheet(0)
```

## Using the Spread Designer

1. Select the **File** menu.
2. Select **Print**.
3. Select **PrintPDF**.
4. Use the **Save** dialog to pick a location and specify a file name.

## See Also

[Printing an Entire Sheet](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-printing/spwin-printactions/spwin-printsheet)
[Printing a Child View of a Hierarchical Display](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-printing/spwin-printactions/spwin-printhierarchy)
[Printing Particular Pages](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-printing/spwin-printactions/spwin-printpages)
[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)