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.
Aspose.Cells directly writes the information about API and Version Number in output documents. For example, upon rendering the Document to PDF, Aspose.Cells for Go via C++ populates the Application field with the value ‘Aspose.Cells’ and PDF Producer field with value, e.g, ‘Aspose.Cells v24.12.0’.
Please note that you cannot instruct Aspose.Cells for Go via C++ to change or remove this information from output Documents.
Direct Conversion
Follow the below steps to directly convert the Excel spreadsheets to PDF format:
- Instantiate an object of the Workbook class by calling its empty constructor.
- You may open/load an existing template file or skip this step if you are creating the workbook from scratch.
- 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.
- 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") |