Convert To A Fax

Conversione di formato compatibile FAX

Questo script converte una serie di documenti o immagini in una serie di file compatibili FAX (b/n 200dpi)

#!/bin/bash
for i in "$@"; do
test -e "$i" || continue
convert -colorspace Gray -density 200 -normalize +dither -threshold 75% \
        -colors 2 -depth 2 -compress Group4 "$i" "$i-FAX"
done

Questo script invece trasforma una sequenza di immagini in un documento PDF/FAX (b/n 200dpi)

#!/bin/bash

for i in "$@"; do
    echo "$i -> $i-FAX.png"
    test -e "$i" || continue
    convert -colorspace Gray -density 200 "$i" -background white -flatten -normalize \
            +dither -threshold 75% -colors 2 -depth 2 -compress Group4 "$i-FAX.png"
done

append=""
for i in "$@"; do
    if [ -e "$i-FAX.png" ]; then 
        echo "$i-FAX.png -> $i-FAX.pdf"
        convert -page a4 "$i-FAX.png" "$i-FAX.pdf"
        rm -f "$i-FAX.png"
    fi
    append="$append '$i-FAX.pdf'"
done

if [ "$append" != " " ]; then
    eval pdftk $append cat output "$1-FAX-ALL.pdf"
    eval rm -f $append
fi
echo "$1-FAX-ALL.pdf"
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.