How to convert ODP to PDF in Python

Have you ever tried to convert an Office Open Document Presentation to a standard PDF and it just wasn’t working right? Us too, and that is why we created our Cloudmersive API to tackle this problem. We hope that it can help to solve your conversion problems as well.

All you need to do is:

Install the Cloudmersive Convert API Client:

pip install cloudmersive-convert-api-client

And then have the Cloudmersive API call the function:

from __future__ import print_functionimport timeimport cloudmersive_convert_api_clientfrom cloudmersive_convert_api_client.rest import ApiExceptionfrom pprint import pprint# Configure API key authorization: Apikeyconfiguration = cloudmersive_convert_api_client.Configuration()configuration.api_key['Apikey'] = 'YOUR_API_KEY'# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed# configuration.api_key_prefix['Apikey'] = 'Bearer'# create an instance of the API classapi_instance = cloudmersive_convert_api_client.ConvertDocumentApi(cloudmersive_convert_api_client.ApiClient(configuration))input_file = '/path/to/file.' # file | Input file to perform the operation on.try:# Convert Office Open Document Presentation ODP to PDFapi_response = api_instance.convert_document_odp_to_pdf(input_file)pprint(api_response)except ApiException as e:print("Exception when calling ConvertDocumentApi->convert_document_odp_to_pdf: %s\n" % e)

Excellent, you have completed all the process of converting an ODP into a PDF in Python!

Image for post
Image for post

We hope that you enjoyed using our Cloudmersive API, and if you are searching for more helpful APIs to assist you with your everyday conversion struggles and more, you can check out our other APIs from Cloudmersive.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store