#!/bin/bash JPEG_QUALITY=10 print_usage() { echo "$(basename $0) -- Numérisation image monochrome 8.5\"x11\" en PDF" echo "Usage: $(basename $0) [OPTIONS...] FICHIER" } if [ "x${1}" = "x--help" ]; then print_usage exit 1 fi if [ ${#} -ne 1 ]; then print_usage exit 1 fi src=${1} scanimage --mode Gray --resolution 200 --scan-area Letter | \ convert - -compress jpeg -quality ${JPEG_QUALITY} ${src}.pdf