Here's a quick one only trivially tested. Save it in a file (say called pdfdir2ebook), make it executable (chmod +x pdf2ebook) and run it as something like:
Code:
./pdfdir2ebook /path/to/dir/with/pdf
If it finds a something.pdf in /path/to/dir/with/pdf it will name the converted copy as something.ebook.pdf in the same directory.
Code:
#!/bin/sh
if [ -d "$1" ]; then
for orig in $1/*.pdf ; do
ebook="${orig%%.pdf}.ebook.pdf"
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile=${ebook} ${orig}
done
else
echo "You must supply the name of a directory as the first argument"
fi
|