This simple topic is about how to convert Presentation to PDF using Python by providing details and configuring the environment to execute the sample code. In order to convert PPTX to PDF Python based code using simple API calls can be used. The application can be tested in any operating system configured with .NET Framework including MS Windows, Linux or macOS.
Steps to Create PowerPoint with Python
- Setup the environment to use Aspose.Slides for Python via .NET in your application
- Include the Aspose.Slides namespace in your project for exporting PPTX to PDF
- Create an instance of the Presentation class to load the source presentation
- Create a PdfOptions class object to set the output PDF options
- Set the desired PDF access password
- The Save method in Python converts PPTX to PDF
The above-mentioned steps in Python convert PPT to PDF files using a simple API interface. We will initiate the process by creating the Presentation class object to load the source presentation file which can be in ODP, PPT, PPTX, POT or POTX format. The PdfOptions class instance will be used to ensure the security of the output PDF by setting a password. Finally, the converted PDF will be saved on the disk using the Save method.
Code to Create PPT using Python
By using Python PPT to PDF converter application is developed. The PdfOptions class exposes different settings like Compliance, JpegQualiy, ImageTransparentColor, SufficientResolution and SaveMetafilesAsPng to further customize the output PDF.
In this article, we witnessed how easily using Python PPTX to PDF converter application can be developed. If you want to create the presentation file using Python, refer to the article on how to create PPT using Python.