Friday, September 30, 2022

Presentation to Image Converter

This article explains how to convert PPT/ Impress (Libreoffice) presentation file(s) to JPG Image(s) in a *NIX (Ubuntu) environment. Presentation file can be made up of several (N) slides which after final conversion yields one JPG image per slide (N JPG files).

Prerequisites software:

  • libreoffice
  • pdftoppm

 Conversion Process:

   PPT            --->     PDF           ----> JPG

   (N-slides)          (N-pages)          ----> JPG

                                                           .....

                                                              ----> JPG (N-JPG files, one per slide)

Steps to Convert

1. Convert PPT file to PDF

$ libreoffice --convert-to pdf "fileName.ppt" --outdir "outputFolderName"

(Note: For the given input file name fileName.ppt, this script creates an output file fileName.pdf in the specified outdir.)

2. Convert PDF to JPG

$ pdftoppm -jpeg -r 200 "outputFolderName/fileName.pdf" "imagePrefix_"

(Note: Image prefix is a text that can be added to the image file names.)

Finally, these steps are put to a shell script to allow it to convert all Presentations newly added to a folder inside called "PRESENTATIONS/Active/" in the user's Home folder.