Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@blog-aspose-cloud
Last active March 14, 2023 08:31
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/242448ddebffe3af85558fbf9e19d676 to your computer and use it in GitHub Desktop.
Save blog-aspose-cloud/242448ddebffe3af85558fbf9e19d676 to your computer and use it in GitHub Desktop.
This Gist contains code snippets to convert PPT to JPEG using Aspose.Slides Cloud SDK for Python
This Gist contains code snippets to convert PPT to JPEG using Aspose.Slides Cloud SDK for Python
def PPT2JPG():
try:
# initialize Aspose.Slides Cloud instance.
configuration = asposeslidescloud.Configuration()
configuration.app_sid = "bbf94a2c-6d7e-4020-b4d2-b9809741374e"
configuration.app_key = "1c9379bb7d701c26cc87e741a29987bb"
slidesApi = asposeslidescloud.SlidesApi(configuration)
# load PPT file from local drive into Stream instance
fileName = "/Users/shahbnay/Downloads/test-unprotected.ppt"
with open(fileName, 'rb') as f:
file = f.read()
# call the API to convert PPT to JPG format and save the output to Cloud storage
request = slidesApi.save_slide_online(file,slide_index=1,format=asposeslidescloud.models.ExportFormat.JPEG,
out_path="Converted.jpeg",width=800,height=1000)
# print result in console
print("Result {0}".format(request))
except ApiException as e:
print("Exception while calling SlidesApi: {0}".format(e))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment