Skip to content

Instantly share code, notes, and snippets.

@cynthiahqy
Created January 28, 2024 13:59
Show Gist options
  • Save cynthiahqy/1c59b9de45ee008eafc1dea68309b2fc to your computer and use it in GitHub Desktop.
Save cynthiahqy/1c59b9de45ee008eafc1dea68309b2fc to your computer and use it in GitHub Desktop.
zsh script for extracting pages of a pdf as images into folder named by source pdf
#!/bin/zsh
## grab filename without extension
filepath=$1
filename=${filepath:r}
## extract pages as images
mkdir ${filename}
convert -quality 100 -density 200 ${filename}.pdf ${filename}/page-%02d.png
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment