Skip to content

Instantly share code, notes, and snippets.

@aspose-cloud
Last active November 30, 2021 04:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aspose-cloud/b06239955cebbc33ac1b67ed52eb3ebd to your computer and use it in GitHub Desktop.
Save aspose-cloud/b06239955cebbc33ac1b67ed52eb3ebd to your computer and use it in GitHub Desktop.
This Gist contains code snippets regarding the conversion of PDF files to Excel format using Aspose.PDF Cloud SDK for Python
This Gist contains code snippets regarding the conversion of PDF files to Excel format using Aspose.PDF Cloud SDK for Python
# For more code samples, please visit https://github.com/aspose-pdf-cloud/aspose-pdf-cloud-python
# For Client credentials, please visit https://dashboard.aspose.cloud/
def pdf2xlsx():
try:
#Client credentials
client_secret = "406b404b2df649611e508bbcfcd2a77f"
client_id = "88d1cda8-b12c-4a80-b1ad-c85ac483c5c5"
#initialize PdfApi client instance using client credetials
pdf_api_client = asposepdfcloud.api_client.ApiClient(client_secret, client_id)
# create PdfApi instance while passing PdfApiClient as argument
pdf_api = PdfApi(pdf_api_client)
#input PDF file name
input_file = 'awesomeTable.pdf'
# name of resultant excel workbook
resultant_file_name = 'Resultant.xlsx'
# Call API to convert PDF to Excel format
response = pdf_api.put_pdf_in_storage_to_xlsx(name=input_file, out_path=resultant_file_name, uniform_worksheets='true')
# print message in console (optional)
print('PDF successfully converted to Excel format !')
except ApiException as e:
print("Exception while calling PdfApi: {0}".format(e))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment