Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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
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