Skip to content

Instantly share code, notes, and snippets.

@aspose-cloud
Last active June 24, 2021 21:19
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/6613e8a9ab58a20e75ab18814a22309b to your computer and use it in GitHub Desktop.
Save aspose-cloud/6613e8a9ab58a20e75ab18814a22309b to your computer and use it in GitHub Desktop.
This Gist contains code snippets related to conversion of PPT to PDF and PDF to PPT conversion in Python
This Gist contains code snippets related to conversion of PPT to PDF and PDF to PPT conversion using Aspose.Slides Cloud SDK for Python
def convert(name):
# initialize Aspose.Slides Cloud instnace.
configuration = asposeslidescloud.Configuration()
configuration.app_sid = "718e4235-8866-4ebe-bff4-f5a14a4b6466"
configuration.app_key = "388e864b819d8b067a8b1cb625a2ea8e"
slidesApi = asposeslidescloud.SlidesApi(configuration)
# load source PPTX file from local drive
try:
fileName = "/Users/nayyershahbaz/Documents/test.pdf"
with open(fileName, 'rb') as f:
file = f.read()
# Create SlideConvertRequest instance and provide input PPTX, resultant format and output file name
request = asposeslidescloud.models.requests.PostSlidesDocumentFromPdfRequest("output.pptx",file)
# Initiate the PPT conversion process
response = slidesApi.post_slides_document_from_pdf(request)
print("Result {0}".format(response))
except ApiException as e:
print("Exception while calling SlidesApi: {0}".format(e.message))
def convert(name):
# initialize Aspose.Slides Cloud instnace.
configuration = asposeslidescloud.Configuration()
configuration.app_sid = "718e4235-8866-4ebe-bff4-f5a14a4b6466"
configuration.app_key = "388e864b819d8b067a8b1cb625a2ea8e"
slidesApi = asposeslidescloud.SlidesApi(configuration)
# load source PPTX file from local drive
try:
fileName = "/Users/nayyershahbaz/Documents/Presentation1.pptx"
with open(fileName, 'rb') as f:
file = f.read()
# Create SlideConvertRequest instance and provide input PPTX, resultant format and output file name
request = asposeslidescloud.models.requests.PutSlidesConvertRequest(file, asposeslidescloud.models.ExportFormat.PDF,"converted.pdf")
# Initiate the PPT conversion process
response = slidesApi.put_slides_convert(request)
print("Result {0}".format(response))
except ApiException as e:
print("Exception while calling SlidesApi: {0}".format(e.message))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment