In this step by step tutorial, we will focus on how to print PowerPoint presentation in Python along with the detailed steps to set up the environment and verify the working sample code. You can use this example in any of Python supported environment including Windows, Linux and macOS to print PPT in Python without any dependency on Microsoft PowerPoint.
Steps to Print PPTX Presentation in Python
- Configure the Python application environment to use Aspose.Slides for Python via .NET
- Include aspose.slides namespaces in your project to print Presentation in Python
- Load the source presentation to print PPTX in Python by creating an instance of the Presentation class
- Create the PrinterSettings object to set the printer settings
- Print the loaded presentation on printer by specifying the printer name
The above steps print PPT presentation in Python by using a few API calls where the process is initiated by loading the source presentation file using the Presentation class. Then by using the PrinterSettings class object different print settings are set, which is followed by providing the printer name as parameter inside the print method to print the presentation file.
Code to Print Presentation in Python
This example provides comprehensive steps and code to print PPTX in Python. The PrinterSettings class object can be used to customize the printing by setting options like page orientation, print copies, margin settings etc. The above application is able to print the presentation on selected printer without installing MS PowerPoint or any other third-party tool.
In this topic, we learnt to print presentation in Python by using a simple API interface. If you are interested in converting the presentation to SVG, refer to the article on how to convert PowerPoint to SVG in Python.