bugfixes, features, documentation, examples, new tool
[hband-tools.git] / pdfrotate / pdfflop
blobc5ee32b0c26620bec399294a4adb815d88182045
1 #!/bin/bash
3 true <<EOF
4 =pod
6 =head1 NAME
8 pdfflop - Flop a PDF file's pages
10 =cut
12 EOF
15 set -e
16 set -o pipefail
17 set -u
19 input=''
20 output=''
22 while [ $# -gt 0 ]
24 case "$1" in
25 --outfile|-o)
26 shift
27 output=$1
29 -*)
30 echo "pdfflop: unknown option: $1" >&2
31 exit 1
34 if [ -z "$input" ]
35 then
36 input=$1
37 else
38 echo "pdfflop: extra argument: $1" >&2
39 exit 2
42 esac
43 shift
44 done
46 pdf90 "$input" -o /dev/stdout | pdfflip /dev/stdin -o /dev/stdout | pdf270 /dev/stdin -o "$output"