Python 3 pdf2pptx Library Script to Convert PDF Documents to PPTX Powerpoint Presentation Slides Full Project For Beginners

Python 3 pdf2pptx Library Script to Convert PDF Documents to PPTX Powerpoint Presentation Slides Full Project For Beginners

 

Welcome folks today in this blog post we will be converting pdf to pptx powerpoint slides using pdf2pptx library in python. All the full source code of the application will be given below.

 

 

Get Started

 

 

Now first of all we need to install the command line utility library by using the pip command as shown below

 

pip install pdf2pptx

 

After installing this library you will initialize a simple command to convert pdf file to powerpoint presentation file as shown below

 

pdf2pptx input.pdf

 

As you can see it takes only one argument namely the path of the input pdf file

 

So now just make an app.py file and copy paste the following code to it

 

app.py

 

 

import subprocess

list_files = subprocess.run(["pdf2pptx", "##inputpathofpdffile###.pdf"])
print("The files are converted successfully")

 

 

Now as you can see in the above python script you need to replace the path of the pdf file and here we are using the subprocess built in python module to execute the shell commands within python application. Now if you execute this python script app.py by typing the below command

READ  Python PyQt5 GUI Script to Build Multi Tabbed Web Browser Using PyQtWebEngine Library Full Project For Beginners

 

python app.py

 

 

 

 

Here we are converting this input book which is pretty long and contain 260 pages as shown below

 

 

 

 

Now after the command finishes it will create a pptx file with the same name inside the same directory where the input pdf file is present as shown below

 

 

 

Leave a Reply