How to convert .pptx slides to .jpg or .png images on Linux in command line?

How to convert .pptx slides to .jpg or .png images on Linux in command line?

This following method works best for me.

First, convert .pptx file to .pdf using libreoffice:

libreoffice --headless --convert-to pdf file.pptx

--headless makes libreoffice run in batch mode and not start the GUI. The pdf file will be named file.pdf by replacing the .pptx with .pdf in the original file name.

Second, convert .pdf file to .jpg using convert:

convert -density 400 -resize 3000^ file.pdf file%d.jpg

-resize 3000^ specifies the width in px of the image files. .jpg images will be named file0, file1, file2, … numbered following the slide numbers.

Answered by Eric Z Ma.

Eric Z Ma

Eric is a father and systems guy. Eric is interested in building high-performance and scalable distributed systems and related technologies. The views or opinions expressed here are solely Eric's own and do not necessarily represent those of any third parties.

Leave a Reply

Your email address will not be published. Required fields are marked *