Convert PDF to Images On MacOS (2024)

Some of my past work in this weird forest

  • Convert PPT to MARKDOWN Two steps are needed where you make a PDF to use as the preview
  • Convert Revealjs to PDF This uses a high-tech thingy so hold onto your seat!

Okay let’s do this

Refer to this Python package pdf2image as the starting point. On Mac be sure to install poppler. Okay this is what you will do:

# brew install poppler
# pip install pdf2image

from pdf2image import convert_from_path
# note that 500 is the dpi
pages = convert_from_path('foo.pdf', 500)

for count, page in enumerate(pages):
    page.save(f'out{count}.jpg', 'JPEG')

Enjoy!