Skip to content

WebNinjaDeveloper.com

Programming Tutorials




Menu
  • Home
  • Youtube Channel
  • Official Blog
  • Nearby Places Finder
  • Direction Route Finder
  • Distance & Time Calculator
Menu

Python 3 Script To Convert Single Or Multiple Powerpoint (.PPTX) Files to PDF Using ppt2pdf Module

Posted on January 17, 2023

 

 

 

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:

 

 

Python
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:

 

 

Python
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'))

 

Recent Posts

  • Android Java Project to Capture Image From Camera & Save it in SharedPreferences & Display it in Grid Gallery
  • Android Java Project to Store,Read & Delete Data Using SharedPreferences Example
  • Android Java Project to Download Multiple Images From URL With Progressbar & Save it inside Gallery
  • Android Java Project to Capture Image From Camera & Save it inside Gallery
  • Android Java Project to Crop,Scale & Rotate Images Selected From Gallery and Save it inside SD Card
  • Angular
  • Bunjs
  • C#
  • Deno
  • django
  • Electronjs
  • java
  • javascript
  • Koajs
  • kotlin
  • Laravel
  • meteorjs
  • Nestjs
  • Nextjs
  • Nodejs
  • PHP
  • Python
  • React
  • ReactNative
  • Svelte
  • Tutorials
  • Vuejs




©2023 WebNinjaDeveloper.com | Design: Newspaperly WordPress Theme