Converting Excel to PDF Files in Python

Aspose.Cells - Converting Excel To PDF

To convert an Excel file to PDF using Aspose.Cells for Java in Python, simply invoke the excel_to_pdf() method of the Converter module.

Python Code

saveFormat = self.SaveFormat

workbook = self.Workbook(self.dataDir + "Book1.xls")

# Save the document in PDF format
workbook.save(self.dataDir + "OutBook1.pdf", saveFormat.PDF)

# Print message
print("\nExcel to PDF conversion performed successfully.")

Download Running Code

Download Converting Excel To PDF (Aspose.Cells) from any of the below-mentioned social coding sites: