Get Started
In order to get started you need to install the below library
using the pip
command as shown below
pip install ppt2pdf
Here is a sample Python 3 script that uses the ppt2pdf
module to convert a single PowerPoint (.pptx) file to a PDF:
1 2 3 |
from ppt2pdf import ppt2pdf ppt2pdf('path/to/input.pptx', 'path/to/output.pdf') |
As you can see we are importing the ppt2pdf
module at the very top and then we are converting the single pptx
to pdf
To convert multiple PowerPoint files, you can use a loop to iterate through a list of file paths and convert each one individually. Here is an example:
1 2 3 4 5 6 |
from ppt2pdf import ppt2pdf files = ['path/to/file1.pptx', 'path/to/file2.pptx', 'path/to/file3.pptx'] for file in files: ppt2pdf(file, file.replace('.pptx', '.pdf')) |