Skip to content

Instantly share code, notes, and snippets.

@rubenwardy
Last active August 29, 2015 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rubenwardy/30bfb1173f9afeecef82 to your computer and use it in GitHub Desktop.
Save rubenwardy/30bfb1173f9afeecef82 to your computer and use it in GitHub Desktop.
Convert folder of images to PDF with filenames
#
# This batch file is specific to Linux.
# (the for, mkdir, rm etc commands may be done differently on your OS.
# the convert commands should be the same though)
#
rm /tmp/imageex -r
mkdir /tmp/imageex
for filename in *.png; do
echo "Processing $filename"
convert $filename -background White label:$filename -gravity Center -append -pointsize 14 /tmp/imageex/$filename.png
done
echo "Exporting to PDF..."
convert /tmp/imageex/*.png output.pdf
echo "Done."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment