Skip to content

Instantly share code, notes, and snippets.

@blog-aspose-cloud
Last active December 4, 2023 09:59
Show Gist options
  • Save blog-aspose-cloud/dc98368ab99497a00a710a0c044b3ea4 to your computer and use it in GitHub Desktop.
Save blog-aspose-cloud/dc98368ab99497a00a710a0c044b3ea4 to your computer and use it in GitHub Desktop.
This Gist contains details for converting Excel to PDF using Aspose.Cells Cloud SDK for Python

Convert Excel to PDF in Python | Spreadsheet to PDF | XLS to PDF


This Gist provides details on how we can load Excel spreadsheet (XLS) and convert to PDF format. The conversion is performed using Aspose.Cells Cloud SDK for Python. In following code sample, we are going to load Excel spreadsheet from Cloud storage and initiate the conversion operation. The resultant PDF is saved in Cloud storage. For complete details, please visit Convert Excel to PDF in Python.

Excel to PDF Conversion Preview

Convert Excel to PDF

Important Links

Home | Product Page | Docs | API Reference | Cloud Dashboard | Code Samples | Source Code | Blog | Free Support | Free Trial

This Gist contains details for converting Excel to PDF using Aspose.Cells Cloud SDK for Python
# For more code samples, please visit https://github.com/aspose-cells-cloud/aspose-cells-cloud-python
def Excel2CSV():
try:
client_secret = "1c9379bb7d701c26cc87e741a29987bb"
client_id = "bbf94a2c-6d7e-4020-b4d2-b9809741374e"
# initialize CellsApi instnace
cellsApi = asposecellscloud.CellsApi(client_id,client_secret)
# input Excel workbook
input_file = "Book1.xlsx"
# resultant format
format = "PDF"
# resultant file name
output = "Converted.pdf"
# call the API to initiate conversion operation
response = cellsApi.cells_workbook_get_workbook(name = input_file, format=format, out_path=output)
# print response code in console
print(response)
except ApiException as e:
print("Exception while calling CellsApi: {0}".format(e))
print("Code:" + str(e.code))
print("Message:" + e.message)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment