Skip to content

Instantly share code, notes, and snippets.

@blog-aspose-cloud
Last active February 8, 2022 21:49
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 blog-aspose-cloud/ae658c22c81677e51562303c4f33f6be to your computer and use it in GitHub Desktop.
Save blog-aspose-cloud/ae658c22c81677e51562303c4f33f6be to your computer and use it in GitHub Desktop.
This Gist contains details and code snippet to convert PPTX to ODP using Aspose.Slides Cloud SDK for Python
This Gist contains details and code snippet to convert PPTX to ODP using Aspose.Slides Cloud SDK for Python
# For more examples, please visit https://github.com/aspose-slides-cloud/aspose-slides-cloud-python
# Get client credentials from https://dashboard.aspose.cloud/
def PPTXtoODP():
try:
# initialize Aspose.Slides Cloud instnace.
configuration = asposeslidescloud.Configuration()
configuration.app_sid = "bbf94a2c-6d7e-4020-b4d2-b9809741374e"
configuration.app_key = "1c9379bb7d701c26cc87e741a29987bb"
slidesApi = asposeslidescloud.SlidesApi(configuration)
# call the API to convert PPTX to ODP format and save the output to Cloud storage
# slides is an optional parameter and in this example, only slide 2 and 3 are converted. If skipped, all slides are converted
request = slidesApi.save_presentation(name='test-unprotected.pptx',format='odp',
out_path="ConvertedFile.odp", slides= '2,3')
print("Result {0}".format(request))
except ApiException as e:
print("Exception when calling SlidesApi->save_presentation: %s\n" % e)
# For more examples, please visit https://github.com/aspose-slides-cloud/aspose-slides-cloud-python
# Get client credentials from https://dashboard.aspose.cloud/
def PPTXtoODP():
try:
# initialize Aspose.Slides Cloud instnace.
configuration = asposeslidescloud.Configuration()
configuration.app_sid = "bbf94a2c-6d7e-4020-b4d2-b9809741374e"
configuration.app_key = "1c9379bb7d701c26cc87e741a29987bb"
slidesApi = asposeslidescloud.SlidesApi(configuration)
# call the API to convert PPTX to ODP format and save the output to Cloud storage
# Since no value for slides parameter is provided, so all the slides are converted by default
request = slidesApi.convert_and_save(document= file,format='odp',out_path="Resultant.odp")
# print response code
print("Result {0}".format(request))
except ApiException as e:
print("Exception when calling SlidesApi->convert_and_save: %s\n" % e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment