Site icon John Maeda’s Blog

Convert PDF to Images On MacOS (2024)

Some of my past work in this weird forest

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!

Exit mobile version