A script that uses imagemagick to generate thumbnails of the first page of PDFs.
We have a folder with PDFs. The script will generate a JPG file of the first page of every PDF, recursively, including any subfolders with PDFs. The filename of the JPG will be the same with the PDF.
Bash script
- Imagemagick
sudo apt-get install imagemagick
Make the script executable chmod +x pdf-thumbn-gener.sh
Run the script ./pdf-thumbn-gener.sh
- The filenames and folder names can contain spaces, greek letters and special characters. They will be processed with no problem.
- Every thumbnail will be saved in the same folder as the PDF.
- The generator will show every conversion and at the end, it will display runtime for informational purpose.
Before | After |
---|---|