Convert Excel Workbook to PDF

Converting Excel Workbook to PDF

Aspose.Cells supports converting Excel files to PDF and maintains high visual fidelity in the conversion.

Direct Conversion

Follow the below steps to directly convert the Excel spreadsheets to PDF format:

  1. Instantiate an object of the Workbook class by calling its empty constructor.
  2. You may open/load an existing template file or skip this step if you are creating the workbook from scratch.
  3. Do any work (input data, apply formatting, set formulas, insert pictures or other drawing objects, and so on) on the spreadsheet using Aspose.Cells' APIs.
  4. When the spreadsheet code is complete, call the Workbook class’s Save method to save the spreadsheet.

The file format should be PDF, so select the relevant PDF (a pre-defined value) from the SaveFormat enumeration to generate the final PDF document

Please see the following sample code, its sample Excel file and the output PDF for your reference.

workbook, _ := NewWorkbook_String("67338368.xlsx")
workbook.Save_String("67338369.pdf")