Prepare JPG Files for Fax

This script prepares your scanned Jpgs for using them e.g. with the sipgate fax. Or you can simply join them together in a small (black&white) pdf. Of course you can change it.

#!/bin/bash
# (c) 2008 linux-tipps.blogspot.com
# published under GPL v. 3.0 or later.

which convert || echo Please install ImageMagick && exit 0;
which sam2p || echo Please install sam2p && exit 0;
which pdftk || echo Please install pdftk && exit 0;

mkdir tmp
cd tmp
ln ../*.jpg .
for i in *.jpg; do nice convert $i -unsharp 3x3 -monochrome $i.png; done
for i in *.png; do sam2p -pdf:b2 $i -pdf: $i.pdf; done
pdftk *.pdf cat output output.pdf
mv output ..
cd ..

rm -rI tmp

No comments:

Post a Comment

I appreciate comments. And I do read them.