This gist explains the steps and code snippet on how to convert PPT / PPTX (PowerPoint) presentations to PDF format and similarly, the conversion of PDF to PPT format using Aspose.Slides Cloud SDK for Python.
For more information, please visit
This gist explains the steps and code snippet on how to convert PPT / PPTX (PowerPoint) presentations to PDF format and similarly, the conversion of PDF to PPT format using Aspose.Slides Cloud SDK for Python.
For more information, please visit
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)) |