Created
November 15, 2022 14:38
-
-
Save optyler/43c43fc845351a543e81dd82a92da9c8 to your computer and use it in GitHub Desktop.
Create `jpg` thumbnail from `pdf` if file is missing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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