summaryrefslogtreecommitdiff
path: root/localpdf2pdfscreen
diff options
context:
space:
mode:
Diffstat (limited to 'localpdf2pdfscreen')
-rwxr-xr-xlocalpdf2pdfscreen16
1 files changed, 9 insertions, 7 deletions
diff --git a/localpdf2pdfscreen b/localpdf2pdfscreen
index 442eb20..cd88a97 100755
--- a/localpdf2pdfscreen
+++ b/localpdf2pdfscreen
@@ -3,29 +3,31 @@
# /usr/local/bin/localpdf2pdfscreen
# Copyright 2008 Jonas Smedegaard <dr@jones.dk>
#
-# $Id: localpdf2pdfscreen,v 1.4 2008-03-17 13:07:47 jonas Exp $
+# $Id: localpdf2pdfscreen,v 1.5 2008-03-17 13:39:17 jonas Exp $
#
# Downsize PDF file.
#
-# TODO: Use *_lowres.pdf as default outfile
-#
set -e
PRG="$(basename "$0")"
# Default options
-PDFTOPSOPTS="-paper match"
+PDFTOPSOPTS="-preload -paper match"
PS2PDFOPTS="-dPDFSETTINGS=/screen"
showhelp() {
cat <<EOF
Usage: $PRG INFILE [ OUTFILE ] [ pdftops opts ] [ -- ps2pdf opts ]
-If missing, OUTFILE is INFILE.pdf (ie. double pdf extension).
+Defaults:
+ OUTFILE: INFILE with trailing ".pdf" replaced with "_lowres.pdf".
+ pdftops: $PDFTOPSOPTS
+ ps2pdfopts $PS2PDFOPTS
Examples:
$PRG newspaper.pdf newspaper_screenready.pdf
+ $PRG newspaper.pdf -level3 --
EOF
}
@@ -59,7 +61,7 @@ while [ $# -gt 0 ]; do
if [ -z "$infile" ]; then
infile="$1"
elif [ -z "$outfile" ]; then
- outfile="$1" ]
+ outfile="$1"
else
exit1 "Too many parameters"
fi
@@ -70,7 +72,7 @@ done
ps2pdfopts="$@"
# Use defaults if not overridden
-outfile="${outfile:-$infile.pdf}"
+outfile="${outfile:-$(basename "$infile" .pdf)_lowres.pdf}"
pdftopsopts="${pdftopsopts:-$PDFTOPSOPTS}"
ps2pdfopts="${ps2pdfopts:-$PS2PDFOPTS}"