You can print a sheet to a Portable Document Format (PDF, version 1.3) file using the PrintToPdf method in the PrintInfo class. Use the PdfFileName 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.
To customize these settings, refer to Understanding the Printing Options and Customizing the Printed Page Header or Footer. To allow Spread to determine the best print settings, refer to Optimizing the Printing Using Rules.
Return to the list for Specifying What to Print.
Using Code
Call the PrintToPdf method in the PrintInfo class to print the specified sheet.
Example
This example code saves the sheet to a PDF file.
C# | Copy Code |
---|---|
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); |
VB | Copy Code |
---|---|
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
- Select the File menu icon (SpreadButton icon).
- Select Print.
- Select PrintPDF.
- Use the Save dialog to pick a location and specify a file name.