Skip to content

Instantly share code, notes, and snippets.

@optyler
Created November 15, 2022 14:38
Show Gist options
  • Save optyler/43c43fc845351a543e81dd82a92da9c8 to your computer and use it in GitHub Desktop.
Save optyler/43c43fc845351a543e81dd82a92da9c8 to your computer and use it in GitHub Desktop.
Create `jpg` thumbnail from `pdf` if file is missing
#!/bin/bash
# requires wkhtmltopdf
for pdf in *pdf; do
filename=$( basename -- "$pdf" )
filename="${filename%.*}"
if [ ! -f "./$filename.jpg" ]
then
convert $pdf $filename.jpg
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment