Skip to content

Instantly share code, notes, and snippets.

@knee-cola
Created August 19, 2024 12:35
Show Gist options
  • Save knee-cola/187432b430a7d64bd074218859296db6 to your computer and use it in GitHub Desktop.
Save knee-cola/187432b430a7d64bd074218859296db6 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Converst pages of the given PDF document into a serie of PNG files (ie: output-1.png, output-2.png, ...)
if [ "$1" == "" ] ; then
printf "\nMissing input file."
printf "\n\nSyntax:\n\n pdf2png.sh input.pdf\n\n"
exit 1
fi
gs -dNOPAUSE -dBATCH -sDEVICE=jpeg -r300x300 -sOutputFile="output-%d.png" $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment