mirror of
https://github.com/rocketraman/sane-scan-pdf.git
synced 2025-05-18 00:20:31 -07:00
Fix usage output
This commit is contained in:
parent
7d2159dc2c
commit
ab56bbcbc1
10
scan
10
scan
@ -21,9 +21,6 @@ PGWIDTH=
|
|||||||
PGWIDTHIN=8.5
|
PGWIDTHIN=8.5
|
||||||
VERBOSE=0
|
VERBOSE=0
|
||||||
|
|
||||||
# The unpaper processing reduces the file size considerably, so 300 dpi is selected.
|
|
||||||
# When not using unpaper (--nodskew) it is recommended to scan at a lower resolution e.g. 200 dpi.
|
|
||||||
|
|
||||||
# Parse command-line options
|
# Parse command-line options
|
||||||
while [ $# -gt 0 ]; do
|
while [ $# -gt 0 ]; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
@ -62,19 +59,20 @@ done
|
|||||||
|
|
||||||
|
|
||||||
if [ $HELP -eq 1 ]; then
|
if [ $HELP -eq 1 ]; then
|
||||||
echo "$(basename $0) [-d|--duplex] [-m|--mode] [-r|--resolution] [-o|--output] [-a|--append] [-e|--max] [-s|--size | [-ph|--page-height] [-pw|--page-width]] [--nodskew]"
|
echo "$(basename $0) [-v|--verbose] [-d|--duplex] [-m|--mode] [-r|--resolution] [-a|--append] [-e|--max <pages>] [-t|--truncate <pages>] [-s|--size | [-ph|--page-height] [-pw|--page-width]] [--deskew] [--ocr] [-o|--output <outputfile>]"
|
||||||
echo " -v Verbose output (this will slow down the scan due to the need to prevent interleaved output)"
|
echo " -v Verbose output (this will slow down the scan due to the need to prevent interleaved output)"
|
||||||
echo " -d Duplex scanning"
|
echo " -d Duplex scanning"
|
||||||
echo " -m Mode e.g. Lineart (default), Halftone, Gray, Color, etc."
|
echo " -m Mode e.g. Lineart (default), Halftone, Gray, Color, etc."
|
||||||
echo " -r Resolution e.g 300 (default)"
|
echo " -r Resolution e.g 300 (default)"
|
||||||
echo " -o Output e.g. scan.pdf (default)"
|
|
||||||
echo " -a Append output to existing scan"
|
echo " -a Append output to existing scan"
|
||||||
echo " -e Max number of pages e.g. 2 (default is all pages)"
|
echo " -e Max number of pages e.g. 2 (default is all pages)"
|
||||||
echo " -t Truncate number of pages from end e.g. 1 (default is none)"
|
echo " -t Truncate number of pages from end e.g. 1 (default is none)"
|
||||||
echo " -s Page Size as type e.g. Letter (default), Legal, A4"
|
echo " -s Page Size as type e.g. Letter (default), Legal, A4"
|
||||||
echo " -ph Custom Page Height in mm"
|
echo " -ph Custom Page Height in mm"
|
||||||
echo " -pw Custom Page Width in mm"
|
echo " -pw Custom Page Width in mm"
|
||||||
echo " --nodskew Do not deskew (no unpaper)"
|
echo " --deskew Run deskew and black edge detection (requires unpaper)"
|
||||||
|
echo " --ocr Run OCR to make the PDF searchable (requires tesseract)"
|
||||||
|
echo " -o Output to named file default=scan.pdf"
|
||||||
echo ""
|
echo ""
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
@ -54,10 +54,10 @@ process_page() {
|
|||||||
if [ $DESKEW -eq 1 ]; then
|
if [ $DESKEW -eq 1 ]; then
|
||||||
log "Applying unpaper post-processing to image data..."
|
log "Applying unpaper post-processing to image data..."
|
||||||
PP_PREFIX="unpaper-"
|
PP_PREFIX="unpaper-"
|
||||||
#unpaper -v --no-mask-scan --overwrite --dpi $RESOLUTION --no-blackfilter $IMAGE_FILE $PP_PREFIX$IMAGE_FILE | logstdout
|
|
||||||
if [ $VERBOSE = 1 ]; then
|
if [ $VERBOSE = 1 ]; then
|
||||||
UNPAPERVERBOSE="-v"
|
UNPAPERVERBOSE="-v"
|
||||||
fi
|
fi
|
||||||
|
#unpaper $UNPAPERVERBOSE --no-mask-scan --overwrite --dpi $RESOLUTION --no-blackfilter $IMAGE_FILE $PP_PREFIX$IMAGE_FILE | logstdout
|
||||||
unpaper $UNPAPERVERBOSE --overwrite --dpi $RESOLUTION $IMAGE_FILE $PP_PREFIX$IMAGE_FILE | logstdout
|
unpaper $UNPAPERVERBOSE --overwrite --dpi $RESOLUTION $IMAGE_FILE $PP_PREFIX$IMAGE_FILE | logstdout
|
||||||
fi
|
fi
|
||||||
log ""
|
log ""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user