summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts/pdfjam/pdfbook
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-04-30 18:17:54 +0000
committerKarl Berry <karl@freefriends.org>2010-04-30 18:17:54 +0000
commit5cc722828d1314a5cb3aaf9c00f2f7cad1988c95 (patch)
treeed4d66c4b46433779ee208db6d5af7b3b3e85b40 /Master/texmf-dist/scripts/pdfjam/pdfbook
parent0e290b30838946f452aa3ea2fd58654e9cc68b1e (diff)
pdfjam update
git-svn-id: svn://tug.org/texlive/trunk@18056 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts/pdfjam/pdfbook')
-rwxr-xr-xMaster/texmf-dist/scripts/pdfjam/pdfbook54
1 files changed, 45 insertions, 9 deletions
diff --git a/Master/texmf-dist/scripts/pdfjam/pdfbook b/Master/texmf-dist/scripts/pdfjam/pdfbook
index 8d032d3a351..2bd3e0fecbf 100755
--- a/Master/texmf-dist/scripts/pdfjam/pdfbook
+++ b/Master/texmf-dist/scripts/pdfjam/pdfbook
@@ -1,19 +1,55 @@
-#!/bin/sh
+#!/bin/sh
##
## pdfbook: Rearrange pages of one or more PDF files into 2-up signatures
##
-## Author David Firth (http://go.warwick.ac.uk/dfirth)
+## Author David Firth (http://go.warwick.ac.uk/dfirth), with help
+## from Marco Pessotto
##
-## This is a simple wrapper for pdfjam, version 2.01
+## This is a simple wrapper for pdfjam, version 2.05
##
-case "${1}" in
- --right-edge-binding)
+case $1 in
+ --short-edge)
+ shortedge=true ;
shift ;
- pdfjam --suffix book --signature* 4 --landscape "$@" ;;
- *)
- pdfjam --suffix book --signature 4 --landscape "$@" ;;
+ ;;
+ *)
+ ;;
esac
-
+for arg
+do
+ case $arg in
+ --signature*)
+ ## catches both --signature and --signature*
+ signature=true ; break
+ ;;
+ *) ;;
+ esac
+done
+##
+## If $signature is empty, we need to use a default:
+##
+if test -z "$signature" ; then
+ signature="--signature 4"
+else
+ signature=""
+fi
+##
+## Make the call to pdfjam:
+##
+if test -z "$shortedge"
+then
+ exec pdfjam --landscape --suffix book $signature "$@"
+else
+ (kpsewhich everyshi.sty >/dev/null) || {
+ echo "the 'everyshi' package is not installed."; exit 1
+ }
+ exec pdfjam --landscape --suffix book $signature \
+ --preamble '\usepackage{everyshi}
+\makeatletter
+\EveryShipout{\ifodd\c@page\pdfpageattr{/Rotate 180}\fi}
+\makeatother
+' "$@"
+fi