This short tutorial is about how to convert PDF to Presentation using Python by providing the detailed configuration steps to set up the environment and use the example code. In Python PDF to PPT conversion can be achieved using a few lines of easy code with no dependence on MS PowerPoint. The application can be used in any operating system including Windows, Linux, and macOS which are configured with Python and .NET Core.
Steps to Import PDF in PowerPoint using Python
- Setup your application to use Aspose.Slides for Python via .NET
- Include reference to aspose.slides namespaces in your project to convert PDF to presentation
- Create a default empty presentation using the Presentation class object
- Access the presentation slides collection and add the source PDF file from the disk
- Use the save method in Python to convert PDF to presentation
The steps mentioned above are followed to insert PDF to presentation using Python where the process is commenced by generating a default empty presentation using the Presentation class instance. Using the SlideCollection.addFromPdf method, the PDF is accessed from the disk and inserted into the presentation slides, followed by saving the generated presentation on the disk using the save method.
Code to Convert PDF to Presentation using Python
In order to convert PDF to PPT Python based API is used where you will have to choose SaveFormat.PPT enumerator inside the save method. The API provides provision to convert the PDF to other presentation formats including POT, POTX, PPS, PPSX, and ODP and you can also load and add multiple PDF files inside the presentation as well.
In this example, we have learnt that in order to add PDF to presentation Python based API can be effectively used by using the simple API Interface. If you want to learn about converting the presentation to PDF, refer to the article on how to convert PPT to PDF using Python.