diff -Nru pdfjam-1.20/bin/pdf180 pdfjam-2.05/bin/pdf180 --- pdfjam-1.20/bin/pdf180 1970-01-01 01:00:00.000000000 +0100 +++ pdfjam-2.05/bin/pdf180 2010-04-25 17:42:00.000000000 +0100 @@ -0,0 +1,11 @@ +#!/bin/sh +## +## pdf180: A shell program to rotate pages of PDF files +## +## Author David Firth (http://go.warwick.ac.uk/dfirth) +## +## This is a simple wrapper for pdfjam, version 2.05 +## +exec pdfjam --suffix rotated180 --angle 180 --fitpaper true "$@" + + diff -Nru pdfjam-1.20/bin/pdf270 pdfjam-2.05/bin/pdf270 --- pdfjam-1.20/bin/pdf270 1970-01-01 01:00:00.000000000 +0100 +++ pdfjam-2.05/bin/pdf270 2010-04-25 17:42:00.000000000 +0100 @@ -0,0 +1,11 @@ +#!/bin/sh +## +## pdf270: A shell program to rotate pages of PDF files +## +## Author David Firth (http://go.warwick.ac.uk/dfirth) +## +## This is a simple wrapper for pdfjam, version 2.05 +## +exec pdfjam --suffix rotated270 --angle 270 --fitpaper true --rotateoversize true "$@" + + diff -Nru pdfjam-1.20/bin/pdf90 pdfjam-2.05/bin/pdf90 --- pdfjam-1.20/bin/pdf90 1970-01-01 01:00:00.000000000 +0100 +++ pdfjam-2.05/bin/pdf90 2010-04-25 17:42:00.000000000 +0100 @@ -0,0 +1,11 @@ +#!/bin/sh +## +## pdf90: A shell program to rotate pages of PDF files +## +## Author David Firth (http://go.warwick.ac.uk/dfirth) +## +## This is a simple wrapper for pdfjam, version 2.05 +## +exec pdfjam --suffix rotated90 --angle 90 --fitpaper true --rotateoversize true "$@" + + diff -Nru pdfjam-1.20/bin/pdfbook pdfjam-2.05/bin/pdfbook --- pdfjam-1.20/bin/pdfbook 1970-01-01 01:00:00.000000000 +0100 +++ pdfjam-2.05/bin/pdfbook 2010-04-25 17:42:00.000000000 +0100 @@ -0,0 +1,55 @@ +#!/bin/sh +## +## pdfbook: Rearrange pages of one or more PDF files into 2-up signatures +## +## Author David Firth (http://go.warwick.ac.uk/dfirth), with help +## from Marco Pessotto +## +## This is a simple wrapper for pdfjam, version 2.05 +## +case $1 in + --short-edge) + shortedge=true ; + shift ; + ;; + *) + ;; +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 + + + diff -Nru pdfjam-1.20/bin/pdfflip pdfjam-2.05/bin/pdfflip --- pdfjam-1.20/bin/pdfflip 1970-01-01 01:00:00.000000000 +0100 +++ pdfjam-2.05/bin/pdfflip 2010-04-25 17:42:00.000000000 +0100 @@ -0,0 +1,9 @@ +#!/bin/sh +## +## pdfflip: A shell program to "flip over" the pages of PDF files +## +## Author David Firth (http://go.warwick.ac.uk/dfirth) +## +## This is a simple wrapper for pdfjam, version 2.05 +## +exec pdfjam --suffix flipped --reflect true --fitpaper true "$@" diff -Nru pdfjam-1.20/bin/pdfjam pdfjam-2.05/bin/pdfjam --- pdfjam-1.20/bin/pdfjam 1970-01-01 01:00:00.000000000 +0100 +++ pdfjam-2.05/bin/pdfjam 2010-04-25 17:42:00.000000000 +0100 @@ -0,0 +1,1228 @@ +#!/bin/sh +version=2.05 +######################################################################### +## ## +## pdfjam: A shell-script interface to the "pdfpages" LaTeX package ## +## ------ ## +## ## +## Author: David Firth (http://go.warwick.ac.uk/dfirth) ## +## ## +## Usage: see http://go.warwick.ac.uk/pdfjam or "pdfjam --help" ## +## ## +## Relies on: ## +## -- pdflatex ## +## -- the 'pdfpages' package for LaTeX (ideally version >= 0.4f) ## +## ## +## License: GPL version 2 or later. This software comes with ## +## ABSOLUTELY NO WARRANTY of fitness for any purpose at all; if you ## +## do not accept that, then you must not use it. ## +## ## +## The path searched for site-wide configuration files can be set ## +## by editing the following variable: ## +## ## + configpath='/etc:/usr/share/etc:/usr/local/share:/usr/local/etc' ## +## ## +## Nothing else in this file should need to be changed. ## +## ## +######################################################################### +## +## PRELIMINARIES +## +## First determine: +## --- whether verbose commentary should be provided (not if --quiet +# or --configpath was specified); +## --- whether this call to pdfjam is a "batch" call; +## --- whether just the help text is required; +## --- or whether all configuration files should be ignored. +## +verbose=true +for arg +do + case $arg in + --quiet | -q | --configpath) + verbose=false ; + ;; + --version | -V) + echo "$version" + exit 0 ; + ;; + --batch) + batch=true ; + ;; + --help | -u | -h) + help=true ; + ;; + --vanilla) + vanilla=true ; + ;; + *) + ;; + esac +done +## +## Check to see whether this is a "secondary" call to pdfjam: +## +if test -z "$PDFJAM_CALL_NUMBER" ## not a secondary call +then + PDFJAM_CALL_NUMBER=0 +fi +## +## Keep a copy of the internal file separator, so we can change it safely +## +OIFS="$IFS" +## +## Record the full filename of the current working diractory +## +pwd=`pwd` +## +## Trap interrupts so that they kill everything: +## +trap 'IFS=$OIFS; exit 1' 1 2 9 15 +## +## The following will be useful for readability of the script: +## +newline=' +' +## +## Define a function to escape tricky characters in file names etc: +## +escape_chars () { + (printf "%s" "${1}" | sed 's/[^a-zA-Z0-9._/\-]/\\&/g') +} +## +## Define a function to output verbose comments: +## +prattle () { ## second argument here is non-null for continuation lines + if test $verbose = true; then + prefix1=" pdfjam:" ; + prefix2=`printf "%s" "$prefix1" | sed 's/pdfjam:/ /'` ; + indent="" ; + if test "$PDFJAM_CALL_NUMBER" -gt 0 && + test "$batch" != true + then + indent=" " + fi + IFS="$newline" ; + lineCounter=0 ; + for line in ${1} + do + lineCounter=`expr $lineCounter + 1` ; + if test $lineCounter -eq 1 && test ! -n "${2}" ; + then + if test -w "$PDFJAM_MESSAGES_FILE" + then printf "$prefix1$indent %s\n" "$line" 1>/dev/null >> \ + "$PDFJAM_MESSAGES_FILE" + else messages="$messages$prefix1$indent $line$newline" + ## msg file not made yet + fi + else + if test -w "$PDFJAM_MESSAGES_FILE" + then printf "$prefix2$indent %s\n" "$line" 1>/dev/null >> \ + "$PDFJAM_MESSAGES_FILE" + else messages="$messages$prefix2$indent $line$newline" + ## msg file not made yet + fi + fi ; + done ; + IFS="$OIFS" ; + fi ; + return ; +} +## +## And here's the first piece of verbose commentary: +## +prattle "----" 1 +prattle "This is pdfjam version ${version}." +## +######################################################################### +## +## CONFIGURATION +## +## THESE SETTINGS WILL BE OVER-RIDDEN by any found in configuration +## files. By default such files are found at any or all of +## /etc/pdfjam.conf +## /usr/share/etc/pdfjam.conf +## /usr/local/share/pdfjam.conf +## /usr/local/etc/pdfjam.conf +## ~/.pdfjam.conf +## (And they are read in that order; if a setting is made more than +## once, the last one prevails.) +## +## An example configuration file can be found at +## http://go.warwick.ac.uk/pdfjam +## +## The path searched for site-wide configuration files can be changed +## by editing the variable 'configpath' at the top of this file. +## +## +## First check whether 'pdflatex' is in the user's path: +## +pdflatex=pdflatex +(hash pdflatex >/dev/null 2>&1) || pdflatex="not found" +## +## +## Likewise for the pdfinfo utility (only needed for `--keepinfo'): +## +pdfinfo='pdfinfo' +(hash pdfinfo >/dev/null 2>&1) || pdfinfo="not found" +## +## +## Next a permitted location for temporary files on your system: +## +tempfileDir='/var/tmp' ## /var/tmp is standard on most unix systems +## +## +## Default for the output file location: +## +outFile="$pwd" ## Output to the current working directory +## +## +## A few more default settings for pdfjam: +## +tidy='true' ## Delete all temporary files at the end +## +keepinfo='false' ## Don't try to preserve "pdfinfo" data +## +checkfiles='false' ## Don't use the Unix 'file -Lb' utility to +## identify PDF files from their contents; +## rely on the .pdf or .PDF extension instead. +## +suffix='pdfjam' ## Default filename suffix to be used when +## --outfile is either (a) a directory, or (b) +## not specified in a --batch call. +## +preamble='' ## Default LaTeX preamble string. +## +paper='a4paper' ## Default paper size is ISO A4. +## +## END OF SETTINGS MADE DIRECTLY WITHIN THE SCRIPT +## +## Now read the site's or user's configuration file(s) if such exist, +## unless '--vanilla' was specified. +## +if test "$vanilla" != true +then + if test "$PDFJAM_CALL_NUMBER" = 0 ## not a secondary call to pdfjam + then + configFiles=`printf "%s" "$configpath" | \ + sed 's/:/\/pdfjam.conf:/g; s/$/\/pdfjam.conf/'` + configFiles="${configFiles}:$HOME/.pdfjam.conf" + PDFJAM_CONFIG="" + prattle "Reading any site-wide or user-specific defaults..." + IFS=':' + for d in $configFiles + do + if test -f "$d"; then + change=`sed '/^ *#.*/d ; s/ *#.*//; s/^ *//' "$d"` + comment="## ${newline}## From ${d}: ${newline}##" + PDFJAM_CONFIG="$PDFJAM_CONFIG$comment$newline$change$newline" + fi + done + IFS="$OIFS" + PDFJAM_CONFIG=`printf "%s" "$PDFJAM_CONFIG" | sed 's/^/ /'` + if test "$batch" = true ; then export PDFJAM_CONFIG ; fi + if test -z "$PDFJAM_CONFIG" + then + prattle "(none found)" 1 + else + prattle "$PDFJAM_CONFIG" 1 + fi + fi + if test -n "$PDFJAM_CONFIG" ; then eval "$PDFJAM_CONFIG" ; fi +else + if test $PDFJAM_CALL_NUMBER -eq 0 + then + prattle "Called with '--vanilla': no user or site configuration" + prattle "files will be read." 1 + fi +fi +## +## END OF CONFIGURATION BLOCK +## +######################################################################### +## +## HELP TEXT +## +## Defines the output of 'pdfjam --help' +## +helptext=" +pdfjam is a shell-script front end to the LaTeX 'pdfpages' package (for +which, see http://www.ctan.org/tex-archive/macros/latex/contrib/pdfpages). + +Usage: pdfjam [OPTIONS] [--] [FILE1 [SEL1]] [FILE2 [SEL2]]... +where +* 'FILE1' etc. are PDF files. For input from /dev/stdin, use the special name + '/dev/stdin' in place of any of FILE1, FILE2, etc: this can be mixed with + 'real' files as needed, to allow PDF data to be input through a pipe (note + that if /dev/stdin is connected to tty, an error results). If 'FILE1' is + absent, pdfjam will use '/dev/stdin' (and will use '-' for the page + selection -- see next item). +* 'SEL1' is a page selection for FILE1, etc. + To select all pages (the default) use '-'. See the pdfpages manual for + more details. An example: + ... file1 '{},2,4-5,9-' ... + makes an empty page, followed by pages 2,4,5,6 of file1, followed by pages + 9 onwards (up to the end of file1). + A page selection can be applied to more than one file, e.g., + ... file1 file2 file3 1-7 ... + applies page selection '1-7' to all three files; but for example + ... file1 file2 2- file3 1-7 ... + would apply the page selection '2-' to file1 and file2, and '1-7' + to file3. A page selection applies to all the files *immediately* + preceding it in the argument list. A missing page selection defaults to + '-'; this includes the case where 'FILE1' is absent and so /dev/stdin gets + used by default. +* 'options' are pdfpages specifications in the form '--KEY VALUE' (see + below), or + --help (or -h, or -u) + Output this text only; no processing of PDF files. + --configpath + Output the 'configpath' variable and exit immediately; no + processing of PDF files. + --version (or -V) + Output the version number of pdfjam and exit immediately; no + processing of PDF files. + --quiet (or -q) + Suppress verbose commentary on progress. + --batch + Run pdfjam sequentially on each input file in turn, and + produce a separate output file for each input, rather + than the default behaviour (which is a single run of + pdfjam on all of the input files, producing a single + output document). For the location of output + files, see '--outfile'. The --batch option cannot be + used in the case of input fron stdin. + --outfile PATH (or -o PATH) + Specifies where the output file(s) will go. If PATH is an + existing directory, pdfjam will attempt to write its + output PDF file(s) there, with name(s) derived from the + input file name(s) and the --suffix option (see below). + Otherwise the output file will be PATH. If '/dev/stdin' + is the only or last input file, PATH cannot be a directory. + Your current default PATH for output is: + $outFile + --suffix STRING + Specifies a suffix for output file names, to be used when + --outfile is either (a) a directory, or + (b) not specified in a --batch call. + A good STRING should be descriptive: for example, + --suffix 'rotated' + would append the text '-rotated' to the name of the input + file in order to make the output file name, as in + 'myfile-rotated.pdf'. The STRING must not have zero + length. + [Default for you at this site: suffix=$suffix] + --checkfiles + --no-checkfiles + If the Unix 'file' utility is available, with options + -L and -b, the output of 'file -Lb FILE1' should be + 'PDF document...' where '...' gives version information. + If this is the case on your system you should use + '--checkfiles'; otherwise use '--no-checkfiles', + in which case all input PDF files must have .pdf or .PDF + as their name extension. + [Default for you at this site: checkfiles=$checkfiles] + --preamble STRING + Append the supplied STRING to the preamble of the LaTeX + source file(s), immediately before the '\begin{document}' + line. An example: + pdfjam --nup 2x2 myfile.pdf -o myfile-4up.pdf \\ + --preamble '\usepackage{fancyhdr} \pagestyle{fancy}' + The '--preamble' option can be used, for example, to load + LaTeX packages and/or to set global options. If '--preamble' + is used more than once in the call, the supplied preamble + strings are simply concatenated. + --keepinfo + --no-keepinfo + Preserve (or not) Title, Author, Subject and Keywords + (from the last input PDF file, if more than one) in the + output PDF file. This requires the pdfinfo utility, from + the xpdf package, and the LaTeX 'hyperref' package; if + either of those is not available, '--keepinfo' is ignored. + [Default for you at this site: keepinfo=$keepinfo] + --pdftitle STRING + --pdfauthor STRING + --pdfsubject STRING + --pdfkeywords STRING + Provide text for the Title, Author, Subject and Keywords + in the output PDF file. Requires the LaTeX 'hyperref' + package. These options, individually, over-ride --keepinfo. + --landscape + --no-landscape + Specify landscape page orientation (or not) in the + output PDF file. + [Default for you at this site: landscape=$landscape] + --twoside + --no-twoside + Specify (or not) the 'twoside' document class option. + [Default for you at this site: twoside=$twoside] + --paper PAPERSPEC (or simply --PAPERSPEC) + Specify a LaTeX paper size, for example + '--paper a4paper' or simply '--a4paper' for ISO A4 paper. + If the LaTeX 'geometry' package is installed, a wider range + of paper sizes is available. For details see documentation + for LaTeX and/or the 'geometry' package. + [Default for you at this site: paper=$paper] + --papersize '{WIDTH,HEIGHT}' + Specify a custom paper size, e.g., + --papersize '{10in,18cm}' + (Note the braces, and the comma!) + If the 'geometry' package is not found, this has no effect. + --pagecolor RGBSPEC + Specify a background colour for the output pages. The + RGBSPEC must be a comma-separated trio of integers + between 0 and 255. An example: + --pagecolor 150,200,150 + [Default is no background colour] + --tidy + --no-tidy + Specify whether the temporary directory created by + pdfjam should be deleted. Use '--no-tidy' to help debug + most errors. + [Default for you at this site: tidy=$tidy] + --vanilla + Suppress the reading of any site-wide or user-specific + configuration files. + --KEY VALUE + Specify options to '\includepdfmerge', in the LaTeX + 'pdfpages' package. Here KEY is the name of any of the + many options for '\includepdfmerge', and VALUE is a + corresponding value. Examples are + --nup 2x1 (for 2-up side-by-side imposition) + --scale 0.7 (to scale all input pages to 70% size) + --offset '1cm 0.5cm' + (to offset all pages -- note the quotes!) + --frame true (to put a frame round each input page) + --trim '1cm 2cm 1cm 2cm' --clip true + (to trim those amounts from left, bottom, + right and top, respectively, of input + pages) + etc., etc. For more information see the manual for + the 'pdfpages' package, at + http://www.ctan.org/tex-archive/macros/latex/contrib/pdfpages +* '--' can be used to signal that there are no more options to come. + +Defaults for the options '--suffix', '--keepinfo', '--paper', '--outfile', +'--landscape', '--twoside', '--tidy', '--checkfiles' and '--preamble' can be +set in site-wide or user-specific configuration files. The path that is +searched for site-wide configuration files (named pdfjam.conf) at this +installation is + $configpath +This configuration path can be changed by editing the pdfjam script if +necessary. Any user-specific configuration should be put in a file named +.pdfjam.conf in your home directory. (All of these files are ignored +if the '--vanilla' argument is used.) + +For more information, including an example configuration file, see +http://go.warwick.ac.uk/pdfjam. +" +## +## END OF HELP TEXT +## +######################################################################### +## +## ERROR CODES +## +E_USAGE=64 # command line usage error +E_DATAERR=65 # data format error +E_NOINPUT=66 # cannot open input +E_UNAVAILABLE=69 # service unavailable +E_SOFTWARE=70 # internal software error +E_CANTCREATE=73 # can't create (user) output file +E_CONFIG=78 # configuration error +## +## Define a function to print an error message and exit: +## +error_exit () { + if (test -r "$PDFJAM_MESSAGES_FILE") + then cat "$PDFJAM_MESSAGES_FILE" >&2 + else printf "$messages" 1>&2 + fi + printf " pdfjam ERROR: %s\n" "$1" 1>&2 ; + exit "$2" ; +} +## +######################################################################### +## +## READ AND PROCESS THE ARGUMENTS +## +## In case of NO argument supplied, mention 'pdfjam --help': +## +if test $# -eq 0 +then + prattle "No arguments supplied; continuing anyway. (See" + prattle "'pdfjam --help' for information on usage.)" 1 +fi +## +## Now do the argument loop. +## +fileSpec="" +miscOptions="" +callOptions="" +optionsFinished="" +## +## First note any '--checkfiles' or '--no-checkfiles' option +## +for arg +do + case $arg in + --checkfiles) + checkfiles=true ; + callOptions="$callOptions --checkfiles" ; + ;; + --no-checkfiles) + checkfiles=false ; + callOptions="$callOptions --no-checkfiles" ; + ;; + esac +done +while test -n "${1}${2}"; do + argUnmatched="" + if test "$optionsFinished" != true + then + case ${1} in + --) ## signals end of command-line options + optionsFinished=true ; + shift ; + continue ; + ;; + --help | -u | -h) + printf "%s\n" "$helptext" ; + exit 0;; + --configpath) + printf "%s\n" "$configpath" ; + exit 0;; + --* | -q | -o) + if test "$pageSpecAwaited" = true ; then + ## fill in any missing page specs before continuing + fileSpec=`printf "%s" "$fileSpec" | sed 's/|awaited/|-/g'` + pageSpecAwaited=false + fi + case ${1} in + --batch) + batch=true ; + ;; + --vanilla) + callOptions="$callOptions ${1}" ; + ;; + --quiet | -q) + verbose=false ; + callOptions="$callOptions ${1}" ; + ;; + --outfile | -o) + outFile="${2}" ; + if test "$batch" = true + then + outFile=`escape_chars "$outFile"` + fi + callOptions="$callOptions --outfile $outFile" ; + shift ;; + --suffix) + if test -n "${2}" + then + suffix="${2}" ; + if test "$batch" = true + then + suffix=`escape_chars "$suffix"` + fi + callOptions="$callOptions --suffix $suffix" + shift + else + error_exit \ + "'--suffix' string has zero length" \ + $E_USAGE ; + fi + ;; + --tidy) + tidy=true ; + callOptions="$callOptions --tidy" ; + ;; + --no-tidy) + tidy=false ; + callOptions="$callOptions --no-tidy" ; + ;; + --keepinfo) + keepinfo=true ; + callOptions="$callOptions --keepinfo" ; + ;; + --no-keepinfo) + keepinfo=false ; + callOptions="$callOptions --no-keepinfo" ; + ;; + --checkfiles) + ;; ## already done above + --no-checkfiles) + ;; ## already done above + --pdftitle) + pdfTitle="${2}" ; + if test "$batch" = true + then + pdfTitle=`escape_chars "$pdfTitle"` + fi + callOptions="$callOptions --pdftitle $pdfTitle" ; + shift ;; + --pdfauthor) + pdfAuthor="${2}" ; + if test "$batch" = true + then + pdfAuthor=`escape_chars "$pdfAuthor"` + fi + callOptions="$callOptions --pdfauthor $pdfAuthor" ; + shift ;; + --pdfsubject) + pdfSubject="${2}" ; + if test "$batch" = true + then + pdfSubject=`escape_chars "$pdfSubject"` + fi + callOptions="$callOptions --pdfsubject $pdfSubject" ; + shift ;; + --pdfkeywords) + pdfKeywords="${2}" ; + if test "$batch" = true + then + pdfKeywords=`escape_chars "$pdfKeywords"` + fi + callOptions="$callOptions --pdfkeywords $pdfKeywords" ; + shift ;; + --paper) + paper="${2}" + callOptions="$callOptions ${1} ${2}" ; + shift ;; + --pagecolor) + pagecolor="${2}" ; + callOptions="$callOptions ${1} ${2}" ; + shift ;; + --a4paper | --a5paper | --b5paper | --letterpaper | \ + --executivepaper | --legalpaper) + ## standard LaTeX paper sizes + paper=`printf "%s" "${1}" | sed 's/^--//'` ; + callOptions="$callOptions ${1}" ; + ;; + --a0paper | --a1paper | --a2paper | --a3paper | \ + --a6paper | --b0paper | --b1paper | --b2paper | \ + --b3paper | --b4paper | --b6paper) + ## the 'geometry' package is needed + if test "$geometry" != false ; + then + paper=`printf "%s" "${1}" | sed 's/^--//'` ; + callOptions="$callOptions ${1}" ; + geometry=true ; + fi ; + ;; + --papersize) + ## the 'geometry' package is needed + if test "$geometry" != false ; + then + papersize="papersize=${2}" ; + callOptions="$callOptions ${1} '${2}'" ; + geometry=true ; + fi ; + shift ;; + --landscape) + landscape=true ; + callOptions="$callOptions --landscape" ; + ;; + --no-landscape) + landscape=false ; + callOptions="$callOptions --no-landscape" ; + ;; + --twoside) + twoside=true ; + callOptions="$callOptions --twoside" ; + ;; + --no-twoside) + twoside=false ; + callOptions="$callOptions --no-twoside" ; + ;; + --preamble) + preamble="$preamble${2}" ; + shift ;; + --*) + ## options for \includepdfmerge + argName=`printf "%s" "${1}" | sed 's/^--//'`; + value="${2}" + miscOptions=$miscOptions,"$argName=$value" ; + ## saved for possible use in LaTeX file + callOptions="$callOptions ${1} '$value'" ; + ## saved for possible use in a further call to pdfjam + shift ; + ;; + esac ;; + '' | *) + argUnmatched=true + ;; + esac + fi + if test "$optionsFinished" = true || test "$argUnmatched" = true + then + case ${1} in + "" | /dev/stdin) + fileSpec="${fileSpec}${newline}/dev/stdin|awaited" + pageSpecAwaited=true + inputFromStdin=true ;; + -) + if test "$pageSpecAwaited" = true ; then + fileSpec=`printf "%s" "$fileSpec" | \ + sed 's/|awaited/|-/g'` + pageSpecAwaited=false + else + error_exit "no PDF file found at ${1}" \ + $E_NOINPUT + fi ;; + *) ## All other args should be PDF source files and page + ## selections; if not, we'll quit + if test "$checkfiles" = true ; ## not always available + then + case `file -Lb "${1}"` in + "PDF document"*|"JPEG image data"*) + ## it's a PDF file as expected + fileSpec="$fileSpec${newline}"${1}"|awaited" + pageSpecAwaited=true + ;; + *) + case ${1} in + *.[pP][dD][fF] | *.[jJ][pP][eE][gG] | \ + *.[jJ][pP][gG]) + ## should be PDF file, but isn't + error_exit "no PDF file found at ${1}" \ + $E_NOINPUT + ;; + *) ## if page spec needed, assume this is it; + ## otherwise something is wrong + if test "$pageSpecAwaited" = true ; then + fileSpec=`printf "%s" "$fileSpec" | \ + sed "s/|awaited/|$1/g"` + pageSpecAwaited=false + else + error_exit "no PDF file found at ${1}" \ + $E_NOINPUT + fi + ;; + esac + ;; + esac + else ## no checking of file contents; rely on .pdf extension + case ${1} in + *.[pP][dD][fF] | *.[jJ][pP][eE][gG] | *.[jJ][pP][gG]) + ## assume it's a PDF file + test -f "${1}" || error_exit \ + "${1} not found" $E_NOINPUT + fileSpec="$fileSpec"$newline${1}"|"awaited + pageSpecAwaited=true + ;; + *) ## if page spec needed, assume this is it; + ## otherwise something is wrong + if test "$pageSpecAwaited" = true ; then + fileSpec=`printf "%s" "$fileSpec" | \ + sed "s/|awaited/|$1/g"` + pageSpecAwaited=false + else + error_exit "no PDF file found at ${1}" \ + $E_NOINPUT + fi + ;; + esac + fi + ;; + esac + fi + shift +done +## +## Use the default page spec for any that remain unspecified: +## +fileSpec=`printf "%s" "$fileSpec" | sed '/^$/d; s/^ //; s/|awaited$/|-/'` +## +## Check whether input from stdin should be used by default: +if test $PDFJAM_CALL_NUMBER -eq 0 && test "$inputFromStdin" != true +then + ## the special argument '/dev/stdin' was not used + if test -z "$fileSpec" ; then + ## no argument specifying a PDF source was given + inputFromStdin=true + fileSpec="/dev/stdin|-" + prattle "No pdf source specified: input is from stdin." + fi +fi +## +## Delete leading comma from $miscOptions: +## +miscOptions=`printf "%s" "$miscOptions" | sed 's/^,//'` +## +if test -n "$preamble" +then callOptions="$callOptions --preamble '$preamble'" +fi +## Delete leading space from $callOptions: +## +callOptions=`printf "%s" "$callOptions" | sed 's/^ //'` +## +## Set up a document options variable: +## +case $landscape in + true) + orientation=landscape ;; + *) + orientation="" ;; +esac +case $twoside in + true) + twoside=twoside ;; + *) + twoside="" ;; +esac +if test "$geometry" != false +then +## we haven't already found that geometry.sty is missing + case $paper in + a0paper | a1paper | a2paper | a3paper | \ + a6paper | b0paper | b1paper | b2paper | \ + b3paper | b4paper | b6paper) + ## the 'geometry' package is needed + geometry=true ; + ;; + *) + ;; + esac +fi +documentOptions="$paper","$orientation","$twoside" +documentOptions=`printf "%s" "$documentOptions" | sed 's/^,//' | sed 's/,$//'` +## +## END OF ARGUMENT PROCESSING +## +######################################################################### +## +## CHECK SYSTEM SETUP +## +## These checks are not repeated in secondary calls. +## +if test $PDFJAM_CALL_NUMBER -eq 0 ## not a secondary call +then + ## Check whether there's a pdflatex, if "$pdflatex" is still unset: + case $pdflatex in + "not found") + error_exit "can't find pdflatex!" $E_UNAVAILABLE + ;; + pdflatex) + ;; + *) ## $pdflatex was set in a configuration file + if test ! -x "$pdflatex" + then + error_exit \ + "configuration error, $pdflatex is not an executable file" \ + $E_CONFIG + fi + ;; + esac + ## + ## Check that necessary LaTeX packages are installed: + ## + modifyPath=`printf "%s" "$pdflatex" | sed 's/\/[^\/]*$//'` + if [ -n "$modifyPath" ] ; then + PATH="$modifyPath:$PATH" + export PATH + fi + (kpsewhich pdfpages.sty >/dev/null) || + error_exit \ + "LaTeX package pdfpages.sty is not installed" \ + $E_UNAVAILABLE + (kpsewhich eso-pic.sty >/dev/null) || + error_exit \ + "LaTeX package eso-pic.sty not installed (see the pdfpages manual)" \ + $E_UNAVAILABLE + (kpsewhich everyshi.sty >/dev/null) || + error_exit \ + "LaTeX package everyshi.sty not installed (see the pdfpages manual)" \ + $E_UNAVAILABLE + if test "$keepinfo" = true || + test -n "$pdfTitle$pdfSubject$pdfAuthor$pdfKeywords" + ## ie, if hyperref is required + then + (kpsewhich hyperref.sty >/dev/null) || { + prattle "LaTeX package hyperref.sty is not installed, so any" + prattle "--keepinfo, --pdftitle,--pdfauthor, --pdfsubject or" 1 + prattle "--pdfkeywords setting will be ignored." 1 + hyperref=false + if test "$batch" = true + then + export hyperref ## for use in any secondary calls + fi + } + else + hyperref=false + fi + if test "$geometry" = true + ## if, if the 'geometry' package is needed for paper size + then + (kpsewhich geometry.sty >/dev/null) || { + prattle "LaTeX package geometry.sty is not installed, so only the" + prattle "standard LaTeX paper sizes are available." 1 + geometry=false + if test "$batch" = true + then + export geometry ## for use in any secondary calls + fi + } + fi +fi +if test "$hyperref" = false +then + keepinfo=false + pdfTitle="" ; pdfAuthor="" ; pdfSubject="" ; pdfKeywords="" +else + if test "$keepinfo" = true + then + case $pdfinfo in + "not found") + if test $PDFJAM_CALL_NUMBER -eq 0 + then + prattle \ + "The pdfinfo utility was not found, so --keepinfo is ignored." + fi + keepinfo=false + ;; + pdfinfo) + ;; + *) ## $pdfinfo was set in a configuration file + if test ! -x "$pdfinfo" + then + if test $PDFJAM_CALL_NUMBER -eq 0 + then + prattle \ + "No pdfinfo utility at $pdfinfo, so --keepinfo is ignored." + keepinfo=false + fi + fi + ;; + esac + fi +fi +## +## END OF CHECKING THE SETUP +## +######################################################################### +## +## TEMPORARY FILES +## +## Make a secure temporary directory (following +## the autoconf manual). +## +## Use mktemp if possible; otherwise fall back on mkdir, +## with random name to make file collisions less likely. +## +original_umask=`umask` +umask 177 +if test $PDFJAM_CALL_NUMBER = 0 ## don't repeat this work for secondary calls +then + PDFJAM_TEMP_DIR='' + trap 'IFS="$OIFS"; \ + if test $tidy != false ; then cd "$pwd"; rm -rf "$PDFJAM_TEMP_DIR"; fi; exit 1' \ + 1 2 9 15 + trap 'IFS="$OIFS"; \ + if test $tidy != false ; then cd "$pwd"; rm -rf "$PDFJAM_TEMP_DIR"; fi' 0 + { + PDFJAM_TEMP_DIR=` + (umask 077 && mktemp -d "$tempfileDir/pdfjam-XXXXXX") 2>/dev/null + ` && + test -n "$PDFJAM_TEMP_DIR" && test -d "$PDFJAM_TEMP_DIR" + } || { + ## We'll use awk to make random number, for portability + random=` + awk 'END { srand(); printf ("%d\n", rand()*1000000); }' /dev/null` + PDFJAM_TEMP_DIR="$tempfileDir"/pdfjam"$$"-"$random" + (umask 077 && mkdir "$PDFJAM_TEMP_DIR") + } || exit $? +## + export PDFJAM_TEMP_DIR ## so that same dir is used in secondary calls + if test $tidy = false ; then + prattle "Temporary directory for this job is + $PDFJAM_TEMP_DIR" + fi + PDFJAM_MESSAGES_FILE="$PDFJAM_TEMP_DIR"/messages.txt + export PDFJAM_MESSAGES_FILE + ## so that secondary calls can write messages there as well + printf "$messages" > "$PDFJAM_MESSAGES_FILE" ## initial file contents + messages="" ## we won't be using this variable again! +else + PDFJAM_TEMP_DIR="$PDFJAM_TEMP_DIR"/"file$PDFJAM_CALL_NUMBER" + (umask 077 && mkdir "$PDFJAM_TEMP_DIR") +fi +umask $original_umask +## +## TEMPORARY DIRECTORY ALL DONE +## +######################################################################### +## +## HANDLING THE "--batch" OPTION +## +## If --batch was used, we'll call pdfjam separately on each input +## file. +## +if test "$batch" = true ; then + if test "$fileSpec" = "" ; then + error_exit "--batch was used, but no PDF source file(s) specified" \ + $E_USAGE + fi + if test "$inputFromStdin" = true ; then + error_exit "--batch cannot be used with input from stdin" \ + $E_USAGE + fi + IFS="$newline" + for k in $fileSpec ; do + sourcePath=`printf "%s" "$k" | sed 's/|[^|]*$//'` + pageSpec=`printf "%s" $k | sed 's/.*|//'` + callNumber=`expr $PDFJAM_CALL_NUMBER + 1` + prattle "--" + prattle "Processing file ${callNumber}, '$sourcePath'..." + prattle "Page spec is '$pageSpec'." + sourcePath=`escape_chars "$sourcePath"` + PDFJAM_EFFECTIVE_CALL="$0 $callOptions -- $sourcePath $pageSpec" + export PDFJAM_EFFECTIVE_CALL + PDFJAM_CALL_NUMBER=$callNumber + export PDFJAM_CALL_NUMBER + eval "$PDFJAM_EFFECTIVE_CALL" + ## i.e., call pdfjam again with one input file + done + if (test $verbose = true) then cat "$PDFJAM_MESSAGES_FILE" >&2 ; fi + IFS=$OIFS + exit 0 +fi +## +## END OF THE '--batch' PROCESSING +## +######################################################################### +## +## RECORD THE EFFECTIVE CALL TO PDFJAM, FOR POSSIBLE DEBUGGING PURPOSES +## +## Save the text of this (effective) call to pdfjam in a temporary file, +## for later inspection if necessary. +## +## For secondary calls, the effective call text is already made; +## otherwise we make it here. +## +if test "$PDFJAM_CALL_NUMBER" -gt 0 +then + theCall="$PDFJAM_EFFECTIVE_CALL" +else + filePageSpec="" + IFS="$newline" + for k in $fileSpec ; do + ## Last substitution on next line is needed for silly characters in + ## file names... + sourcePath=`printf "%s" $k | sed 's/|[^|]*$//'` + sourcePath=`escape_chars "$sourcePath"` + pageSpec=`printf "%s" $k | sed 's/.*|//'` + filePageSpec="$filePageSpec$sourcePath $pageSpec " + done + IFS="$OIFS" + theCall="$0 $callOptions -- $filePageSpec" +fi +printf "%s\n%s\n" "cd $pwd" "$theCall" > "$PDFJAM_TEMP_DIR"/call.txt +prattle "Effective call for this run of pdfjam:" +prattle "$theCall" 1 +## +######################################################################### +## +## NOW MAKE THE INPUT FILE ETC., READY FOR PDFLATEX +## +filePageList="" ## initialize a string to supply to \includepdfmerge +counter=0 +## +## Make symbolic link(s) to the source file(s) in the temporary dir, +## and make the $filePageList string for input to \includepdfmerge +## +stdinUnread=true +IFS="$newline" +for k in ${fileSpec} +do + counter=`expr $counter + 1` + sourcePath=`printf "%s" "$k" | sed 's/|[^|]*$//'` + pageSpec=`printf "%s" $k | sed 's/.*|//'` + ## Check, though not exhaustively, for problems with the + ## page spec: leading or trailing comma, double comma or + ## double dash, alphabetic characters other than the word "last", + ## braces not paired as {} with nothing inbetween. A fully + ## specified pattern for valid \includepdfmerge page spec would + ## be better here; but life is too short... + if printf "%s" "$pageSpec" | sed 's/last/99/g' | \ + grep '^,.*\|,$\|,,\|--\|[A-Za-z]\|{[^}]\|[^{]}' 1>/dev/null + then + error_exit "invalid page spec $pageSpec" $E_USAGE + fi + case $sourcePath in + /dev/stdin) + uniqueName="$PDFJAM_TEMP_DIR"/stdin.pdf + if test "$stdinUnread" = true + then + if tty -s ; then + error_exit \ + "tty is connected to connected to stdin, no PDF file found" \ + $E_NOINPUT + fi + cat > "$uniqueName" + stdinUnread=false + fi + ;; + *) + pdfName=`basename "$sourcePath"` + sourceDir=`dirname "$sourcePath"` ## zsh on Mac OS 10.5 chokes here + cd "$sourceDir" || exit 1 ## just to get the full path + sourceDir=`pwd` + cd "$pwd" || exit 1 + sourceFullPath="$sourceDir"/"$pdfName" + uniqueName="source-$counter.pdf" + uniqueName="$PDFJAM_TEMP_DIR"/"$uniqueName" + ln -s "$sourceFullPath" "$uniqueName" + ;; + esac + filePageList="$filePageList","$uniqueName","$pageSpec" +done +IFS="$OIFS" +filePageList=`printf "%s" "$filePageList" | \ + sed 's/^,//'` ## remove leading comma +## +## Do the pdfinfo stuff (if relevant)... +## +if test "$hyperref" != false +then + if test "$keepinfo" = true + then + prattle "Calling ${pdfinfo}..." ; + PDFinfo=`pdfinfo "$uniqueName"`; + pdftitl=`printf "%s" "$PDFinfo" | \ + grep -e '^Title:'| sed s/^Title:\\\s\*// | \ + sed -e 's/[#$%^&_{}~]/\\\&/g'`; + pdfauth=`printf "%s" "$PDFinfo" | \ + grep -e '^Author:'| sed s/^Author:\\\s\*// | \ + sed -e 's/[#$%^&_{}~]/\\\&/g'`; + pdfsubj=`printf "%s" "$PDFinfo" | \ + grep -e '^Subject:'| sed s/^Subject:\\\s\*// | \ + sed -e 's/[#$%^&_{}~]/\\\&/g'`; + pdfkeyw=`printf "%s" "$PDFinfo" | \ + grep -e '^Keywords:'| sed s/^Keywords:\\\s\*// | \ + sed -e 's/[#$%^&_{}~]/\\\&/g'`; + fi + if test -n "$pdfTitle" ; then + pdftitl="$pdfTitle" + fi + if test -n "$pdfAuthor" ; then + pdfauth="$pdfAuthor" + fi + if test -n "$pdfSubject" ; then + pdfsubj="$pdfSubject" + fi + if test -n "$pdfKeywords" ; then + pdfkeyw="$pdfKeywords" + fi +fi +## +## Now set up the files for pdflatex... +## +fileName="$PDFJAM_TEMP_DIR"/a +texFile="$fileName".tex +msgFile="$fileName".msgs +tempFile="$PDFJAM_TEMP_DIR"/temp.tex +(cat < $texFile +if test "$hyperref" = false; then ## we don't need hyperref + cp $texFile $tempFile + sed '/\\\usepackage{hyperref}/d' $tempFile | \ + sed '/\\\hypersetup.*/d' > "${texFile}" + rm $tempFile +fi +if test -z "$geometry" ; then geometry=false ; fi +if test "$geometry" = false; then ## geometry package is not to be used + cp $texFile $tempFile + cat $tempFile | sed '/\\\usepackage.*{geometry}/d' > $texFile + rm $tempFile +fi +if test -z "$pagecolor"; then ## color package is not needed + cp $texFile $tempFile + cat $tempFile | sed '/\\\usepackage.*{color}/d' > $texFile + rm $tempFile +fi +## +## INPUT FILES ARE ALL READY +## +######################################################################### +## +## RUN PDFLATEX AND COPY THE RESULTING PDF FILE +## +prattle "Calling ${pdflatex}..." ; +cd "$PDFJAM_TEMP_DIR" || exit 1 +failureText=\ +"FAILED. +The call to 'pdflatex' resulted in an error. +If '--no-tidy' was used, you can examine the +log file at + $fileName.log +to try to diagnose the problem." +$pdflatex $texFile > $msgFile || { + prattle "$failureText" + error_exit "Output file not written" $E_SOFTWARE +} +cd "$pwd" || exit 1 +if test -f "$fileName".pdf ## if LaTeX didn't choke +then + ## Checks on output file path: + if test -d "$outFile" ## outfile is a directory + then + if test "$sourcePath" = /dev/stdin + then + error_exit \ + "--outfile cannot be a directory when input is stdin" \ + $E_USAGE + fi + if test ! -w "$outFile" + then + prattle "FAILED: no write permission in ${outFile}." + continue + fi + separator="-" + if test "$pageSpec" != "-" + then + separator=-"$pageSpec"- + fi + outFile=`printf "%s" "$outFile" | sed 's/\/$//'` + ## (delete any trailing slash) + pdfName=`basename "$sourcePath"` + pdfName=`printf "%s" "$pdfName" | \ + sed 's/\.[pP][dD][fF]$//'` ## strip extension + pdfName="$pdfName$separator$suffix".pdf + outFile="$outFile"/"$pdfName" + fi +fi +if test -f "$outFile" && test ! -w "$outFile" + ## file exists and we can't over-write it +then + error_exit "no write permission at ${outFile}" $E_CANTCREATE +fi +#fileSize=`wc -c < "$fileName.pdf" | sed 's/^\ *//'` +(cat "$fileName".pdf > "$outFile" 2>/dev/null) && + prattle "Finished. Output was to '${outFile}'." || + error_exit "cannot write output at ${outFile}" $E_CANTCREATE +if (test "$PDFJAM_CALL_NUMBER" = "0") && ## not a secondary call + (test $verbose = true) +then cat "$PDFJAM_MESSAGES_FILE" >&2 +fi +exit 0 +## +## END +## +######################################################################### diff -Nru pdfjam-1.20/bin/pdfjam-pocketmod pdfjam-2.05/bin/pdfjam-pocketmod --- pdfjam-1.20/bin/pdfjam-pocketmod 1970-01-01 01:00:00.000000000 +0100 +++ pdfjam-2.05/bin/pdfjam-pocketmod 2010-04-25 17:42:00.000000000 +0100 @@ -0,0 +1,57 @@ +#!/bin/sh +## +## pdfjam-pocketmod: A shell program to make an 8-page PDF document +## into an 8-up file with pages ordered and oriented for folding as +## a pocket-sized booklet, as described at http://repocketmod.com/ +## +## Author David Firth (http://go.warwick.ac.uk/dfirth) +## +## This is a simple wrapper for (three runs of) pdfjam, version 2.05 +## +## +## It's hard (?) to set up this particular script to read from /dev/stdin, +## so we'll just insist that the first argument is a file: +## +E_USAGE=64 ## for a command line usage error +for arg +do + case $arg in + --batch) + printf "pdfjam-pocketmod ERROR: the --batch option is not allowed\n" 1>&2 ; + exit "$E_USAGE" ;; + --no-tidy) + n='--no-tidy' ;; + --quiet | -q) + q='-q' ;; + --vanilla) + v='--vanilla' ;; + --checkfiles) + c='--checkfiles' ;; + *) + ;; + esac +done +## +sourceFile="$1" ; +shift ; +## +## Some (very) minimal checking of the first argument: +## +if test ! -f "$sourceFile" ; +then + printf "pdfjam-pocketmod ERROR: first argument must be a PDF file\n" ; + exit $E_USAGE ; +fi +## +## That's all the argument checking! +## +pageSpec="1-8" ## the default page spec +case ${1} in + --* | "") ## no page spec was given + ;; + *) ## a page spec was given, so use it + pageSpec="$1" ; + shift ;; +esac +pdfjam $n $q $c $v -o /dev/stdout "$sourceFile" "$pageSpec" | pdfjam --angle 180 $n $q $v -o /dev/stdout /dev/stdin '1,8,7,6' | pdfjam --nup 4x2 --landscape --frame true "$sourceFile" '2-5' /dev/stdin "$@" + diff -Nru pdfjam-1.20/bin/pdfjam-slides3up pdfjam-2.05/bin/pdfjam-slides3up --- pdfjam-1.20/bin/pdfjam-slides3up 1970-01-01 01:00:00.000000000 +0100 +++ pdfjam-2.05/bin/pdfjam-slides3up 2010-04-25 17:42:00.000000000 +0100 @@ -0,0 +1,29 @@ +#!/bin/sh +## +## pdfjam-slides3up: A shell program to make a 3-up "handout" +## of presentation slides, with space for side-notes +## +## Author David Firth (http://go.warwick.ac.uk/dfirth) +## +## This is a simple wrapper for pdfjam, version 2.05 +## +footskip=3.1cm ## default setting +pagecommand='{\thispagestyle{empty}}' ## default setting +case ${1} in + --pagenumbering) + case ${2} in + false) + continue ;; + true) + pagecommand='{\thispagestyle{plain}}' ;; + *) ## a footskip dimension was supplied + pagecommand='{\thispagestyle{plain}}' ; + footskip="$2" ;; + esac ; + shift; shift ;; + *) + continue ;; +esac +exec pdfjam --suffix 3up --nup 1x3 --frame true --noautoscale false \ + --delta "0cm 0.2cm" --scale 0.87 --offset "-3.8cm 0cm" \ + --preamble "\footskip $footskip" --pagecommand "$pagecommand" "$@" diff -Nru pdfjam-1.20/bin/pdfjam-slides6up pdfjam-2.05/bin/pdfjam-slides6up --- pdfjam-1.20/bin/pdfjam-slides6up 1970-01-01 01:00:00.000000000 +0100 +++ pdfjam-2.05/bin/pdfjam-slides6up 2010-04-25 17:42:00.000000000 +0100 @@ -0,0 +1,31 @@ +#!/bin/sh +## +## pdfjam-slides6up: A shell program to make a 6-up "handout" +## of presentation slides +## +## Author David Firth (http://go.warwick.ac.uk/dfirth) +## +## This is a simple wrapper for pdfjam, version 2.05 +## +footskip=2.7cm ## default setting +pagecommand='{\thispagestyle{empty}}' ## default setting +case ${1} in + --pagenumbering) + case ${2} in + false) + continue ;; + true) + pagecommand='{\thispagestyle{plain}}' ;; + *) ## a footskip dimension was supplied + pagecommand='{\thispagestyle{plain}}' ; + footskip="$2" ;; + esac ; + shift; shift ;; + *) + continue ;; +esac +exec pdfjam --suffix 6up --nup 2x3 --frame true --noautoscale false \ + --delta "0.2cm 0.3cm" --scale 0.95 --preamble "\footskip $footskip" \ + --pagecommand "$pagecommand" "$@" + + diff -Nru pdfjam-1.20/bin/pdfjoin pdfjam-2.05/bin/pdfjoin --- pdfjam-1.20/bin/pdfjoin 1970-01-01 01:00:00.000000000 +0100 +++ pdfjam-2.05/bin/pdfjoin 2010-04-25 17:42:00.000000000 +0100 @@ -0,0 +1,26 @@ +#!/bin/sh +## +## pdfjoin: A shell program to concatenate PDF files +## +## Author David Firth (http://go.warwick.ac.uk/dfirth) +## +## This is a simple wrapper for pdfjam, version 2.05 +## +E_USAGE=64 ## for a command line usage error +for arg +do + case $arg in + --batch) + printf "pdfjoin ERROR: the --batch option is not allowed\n" 1>&2; + exit "$E_USAGE" ;; + --orient) ## this was allowed in previous versions of pdfjoin + printf "pdfjoin ERROR: the --orient option is not allowed,\n" 1>&2; + printf " use --landscape or --no-landscape to specify\n" 1>&2; + printf " the output page orientation" 1>&2; + exit "$E_USAGE" ;; + *) continue ;; + esac +done +exec pdfjam --fitpaper true --rotateoversize true --suffix joined "$@" + + diff -Nru pdfjam-1.20/bin/pdfnup pdfjam-2.05/bin/pdfnup --- pdfjam-1.20/bin/pdfnup 1970-01-01 01:00:00.000000000 +0100 +++ pdfjam-2.05/bin/pdfnup 2010-04-25 17:42:00.000000000 +0100 @@ -0,0 +1,29 @@ +#!/bin/sh +## +## pdfnup: A shell program to n-up pages of PDF files +## +## Author David Firth (http://go.warwick.ac.uk/dfirth) +## +## This is a simple wrapper for pdfjam, version 2.05 +## +E_USAGE=64 ## for a command line usage error +for arg +do + case $arg in + --orient) ## this was allowed in previous versions of pdfnup + printf "pdfnup ERROR: the --orient option is not allowed,\n" 1>&2; + printf " use --landscape or --no-landscape to specify\n" 1>&2; + printf " the output page orientation" 1>&2; + exit "$E_USAGE" ;; + --pages) ## this was allowed in previous versions of pdfnup + printf "pdfnup ERROR: the --pages option is not allowed,\n" 1>&2; + printf " see 'pdfjam --help' or http://go.warwick.ac.uk/pdfjam\n" \ + 1>&2; + printf " for page selection examples\n" 1>&2; + exit "$E_USAGE" ;; + *) continue ;; + esac +done +exec pdfjam --suffix nup --nup 2x1 --landscape "$@" + + diff -Nru pdfjam-1.20/bin/pdfpun pdfjam-2.05/bin/pdfpun --- pdfjam-1.20/bin/pdfpun 1970-01-01 01:00:00.000000000 +0100 +++ pdfjam-2.05/bin/pdfpun 2010-04-25 17:42:00.000000000 +0100 @@ -0,0 +1,73 @@ +#!/bin/sh +## +## pdfpun: A shell program to n-up pages of a PDF file with +## the n-upped pages ordered from right to left +## +## Author David Firth (http://go.warwick.ac.uk/dfirth) +## +## This is a simple wrapper for (three runs of) pdfjam, version 2.05 +## +## +E_USAGE=64 ## for a command line usage error +## +for arg +do + case $arg in + --batch) + printf "pdfpun ERROR: the --batch option is not allowed\n" 1>&2; + exit "$E_USAGE" ;; + --no-tidy) + n='--no-tidy' ;; + --quiet | -q) + q='-q' ;; + --checkfiles) + c='--checkfiles' ;; + *) continue ;; + esac +done +sourceFile="$1" ; +shift ; +## +## Some (very) minimal checking of the first argument: +## +if test ! -f "$sourceFile" ; +then + printf "pdfpun ERROR: first argument must be a PDF file\n" ; + exit $E_USAGE ; +fi +if test "$sourceFile" = /dev/stdin ; +then + if tty -s ; then + printf "pdfpun ERROR: tty is connected to connected to stdin, no PDF file found\n" + exit $E_USAGE ; + fi +fi +## +## That's all the argument checking! +## +pageSpec="-" ## the default +case ${1} in + --* | "") + ;; + *) ## a page spec was given + pageSpec="$1" ; + shift ;; +esac +case ${1} in + --outfile) + outFile="$2" ; + shift; shift ;; + *) + ;; +esac +if test -z "$outFile" ; +then + printf "pdfpun ERROR: no output file specified\n" 1>&2 ; + exit "$E_USAGE" ; +fi +pdfjam --reflect true $n $q $c "$sourceFile" "$pageSpec" -o /dev/stdout | \ + pdfjam --landscape --nup 2x1 "$@" -o /dev/stdout | \ + pdfjam --suffix nup --reflect true --fitpaper true $n $q -o "$outFile" + + + diff -Nru pdfjam-1.20/debian/changelog pdfjam-2.05/debian/changelog --- pdfjam-1.20/debian/changelog 2010-05-28 14:36:17.000000000 +0100 +++ pdfjam-2.05/debian/changelog 2010-05-28 14:36:17.000000000 +0100 @@ -1,10 +1,32 @@ -pdfjam (1.20-2ubuntu1) intrepid; urgency=low +pdfjam (2.05-2) unstable; urgency=low - * debian/control: Do not prefer tetex-extra, that transitional package pulls - in a ridiculously huge dependency set. Swap the dependencies around. - (partially solves Debian #436256) + * moved texlive-latex-recommended-doc to Suggests (closes: #579310) - -- Martin Pitt Fri, 25 Jul 2008 15:47:52 +0200 + -- Eduard Bloch Sun, 09 May 2010 17:02:40 +0200 + +pdfjam (2.05-1) unstable; urgency=low + + * New upstream release (incorporates our changes) + + -- Eduard Bloch Sun, 25 Apr 2010 22:50:11 +0200 + +pdfjam (2.03-1) unstable; urgency=low + + * New upstream release + + --outfile writes to current directory (closes: #393839) + + uses default system shell (closes: #417772) + + uses geometry package (closes: #446951) + + direct passing of pdfpages options is now possible (like clip and + reflect, closes: #381807, #507383) + * added consideration of JPEG input (closes: #563496) + * stop using our manpages, installing only upstream versions + (closes: #393838, #565444, #352373) + * dropped (primary) dependency on tetex (closes: #436256) + * upstream manpage syntax fixes + * lots of minor fixes for compliancy to new standards + * using exec for pdfjam subcalls to do less forks + + -- Eduard Bloch Tue, 20 Apr 2010 20:49:36 +0200 pdfjam (1.20-2) unstable; urgency=low diff -Nru pdfjam-1.20/debian/compat pdfjam-2.05/debian/compat --- pdfjam-1.20/debian/compat 2010-05-28 14:36:17.000000000 +0100 +++ pdfjam-2.05/debian/compat 2010-05-28 14:36:17.000000000 +0100 @@ -1 +1 @@ -4 +7 diff -Nru pdfjam-1.20/debian/control pdfjam-2.05/debian/control --- pdfjam-1.20/debian/control 2010-05-28 14:36:17.000000000 +0100 +++ pdfjam-2.05/debian/control 2010-05-28 14:36:17.000000000 +0100 @@ -1,14 +1,14 @@ Source: pdfjam Section: text Priority: optional -Maintainer: Ubuntu MOTU Developers -XSBC-Original-Maintainer: Eduard Bloch -Build-Depends: debhelper (>= 4.0.0) -Standards-Version: 3.6.2.1 +Maintainer: Eduard Bloch +Build-Depends: debhelper (>= 7.0.0) +Standards-Version: 3.8.4 Package: pdfjam Architecture: all -Depends: texlive-latex-recommended | tetex-extra, texlive-fonts-recommended | tetex-extra +Depends: texlive-latex-recommended, texlive-fonts-recommended, ${misc:Depends} +Suggests: texlive-latex-recommended-doc Description: collection of PDF document handling utilities PDFjam is a small collection of shell scripts that work similarly to the well known psutils (psmerge, psnup). They provide a simple diff -Nru pdfjam-1.20/debian/copyright pdfjam-2.05/debian/copyright --- pdfjam-1.20/debian/copyright 2010-05-28 14:36:17.000000000 +0100 +++ pdfjam-2.05/debian/copyright 2010-05-28 14:36:17.000000000 +0100 @@ -5,13 +5,12 @@ Upstream Author: David Firth -Copyright: +Copyright: 2002 - 2010 David Firth -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or (at -your option) any later version. +License: GPL version 2 or later. This software comes with +ABSOLUTELY NO WARRANTY of fitness for any purpose at all; if you +do not accept that, then you must not use it. -You can find the complete text of the GPLv2 in the file -/usr/share/common-licenses/GPL-2 on Debian systems. +On Debian systems, the complete text of the GNU General Public +License, version 2, can be found in /usr/share/common-licenses/GPL-2. diff -Nru pdfjam-1.20/debian/NEWS pdfjam-2.05/debian/NEWS --- pdfjam-1.20/debian/NEWS 1970-01-01 01:00:00.000000000 +0100 +++ pdfjam-2.05/debian/NEWS 2010-05-28 14:36:17.000000000 +0100 @@ -0,0 +1,9 @@ +pdfjam (2.05-1) unstable; urgency=low + + * This is a major release of pdfjam. It changes the semantics of some + options in a few cases. This includes --landscape, --pages and --outfile + options. Users of that options should read PDFjam-README.html in + documentation directory for further information about incompatible + changes. + + -- Eduard Bloch Mon, 19 Apr 2010 23:21:10 +0200 diff -Nru pdfjam-1.20/debian/pdfjam.doc-base pdfjam-2.05/debian/pdfjam.doc-base --- pdfjam-1.20/debian/pdfjam.doc-base 2010-05-28 14:36:17.000000000 +0100 +++ pdfjam-2.05/debian/pdfjam.doc-base 2010-05-28 14:36:17.000000000 +0100 @@ -3,10 +3,8 @@ Author: David Firth Abstract: This manual describes what PDFjam tools are and how to modify PDF documents with it. -Section: text +Section: Text Format: HTML Index: /usr/share/doc/pdfjam/PDFjam-README.html Files: /usr/share/doc/pdfjam/PDFjam-README.html - - diff -Nru pdfjam-1.20/debian/pdfjam.manpages pdfjam-2.05/debian/pdfjam.manpages --- pdfjam-1.20/debian/pdfjam.manpages 2010-05-28 14:36:17.000000000 +0100 +++ pdfjam-2.05/debian/pdfjam.manpages 2010-05-28 14:36:17.000000000 +0100 @@ -1,2 +1 @@ -debian/*.1 diff -Nru pdfjam-1.20/debian/rules pdfjam-2.05/debian/rules --- pdfjam-1.20/debian/rules 2010-05-28 14:36:17.000000000 +0100 +++ pdfjam-2.05/debian/rules 2010-05-28 14:36:17.000000000 +0100 @@ -52,24 +52,21 @@ install: build dh_testdir dh_testroot - dh_clean -k + dh_prep dh_installdirs # Add here commands to install the package into debian/pdfjam. #$(MAKE) install DESTDIR=$(CURDIR)/debian/pdfjam - install scripts/* $(CURDIR)/debian/pdfjam/usr/bin + install bin/* $(CURDIR)/debian/pdfjam/usr/bin -# Build architecture-independent files here. -binary-indep: build install -# We have nothing to do by default. - -# Build architecture-dependent files here. binary-arch: build install + +binary-indep: build install dh_testdir dh_testroot dh_installchangelogs dh_installdocs - dh_installexamples + dh_installexamples pdfjam.conf # dh_install # dh_installmenu # dh_installdebconf @@ -80,7 +77,9 @@ # dh_installinit # dh_installcron # dh_installinfo - dh_installman + dh_installman -v man1/*.1 +# some of ours our better +# dh_installman -v debian/pdfjoin.1 debian/pdfnup.1 dh_link dh_strip dh_compress -XPDFjam-README.html diff -Nru pdfjam-1.20/debian/source/format pdfjam-2.05/debian/source/format --- pdfjam-1.20/debian/source/format 1970-01-01 01:00:00.000000000 +0100 +++ pdfjam-2.05/debian/source/format 2010-05-28 14:36:17.000000000 +0100 @@ -0,0 +1 @@ +1.0 diff -Nru pdfjam-1.20/man1/pdf180.1 pdfjam-2.05/man1/pdf180.1 --- pdfjam-1.20/man1/pdf180.1 1970-01-01 01:00:00.000000000 +0100 +++ pdfjam-2.05/man1/pdf180.1 2010-04-25 16:48:50.000000000 +0100 @@ -0,0 +1,74 @@ +.TH "pdf180" "1" "10 March 2010" "" "" +.SH "NAME" +pdf180 \- rotate the pages of pdf files +.SH "SYNOPSIS" +.PP +pdf180 [OPTION [OPTION] \&.\&.\&.] [SRC [PAGESPEC] [SRC [PAGESPEC]] \&.\&.\&.] +.PP +.SH "DESCRIPTION" +.PP +pdf180 rotates the pages of files in the Adobe Portable Document Format (PDF) +through 180 degrees\&. +.PP +If no source PDF file ('SRC') is specified, input +is from /dev/stdin. If 'PAGESPEC' is omitted, all pages are processed. +.PP +Source files are processed sequentially into a single output +unless the '--batch' option is used, in which case they are processed +separately. +.PP +pdf180 operates on one or more PDF files, and (either with the '--batch' +option or with '--outfile DIR' where 'DIR' is a directory) the +resulting files have +the suffix '-rotated180' applied to their names by default. To change +the suffix, +use the '--suffix' option, for example +.PP +.RS +.B pdf180 --suffix 'upturned' --batch myfile1.pdf myfile2.pdf +.RE +.PP +will result in files named 'myfile1-upturned.pdf' and 'myfile2-upturned.pdf'. +.PP +pdf180 is a simple wrapper for pdfjam, which is a front end to many of the capabilities of the pdfpages +package for pdflatex\&. A working installation of pdflatex with +the pdfpages package is required\&. +.PP +pdf180 is part of the "PDFjam" package of tools, whose homepage is at +http://go.warwick.ac.uk/pdfjam\&. +.PP +.SH "SETUP" +.PP +See http://go.warwick.ac.uk/pdfjam . +.PP +.SH "USAGE" +.PP +For the available options and site/user defaults, see the output of +.PP +.RS + pdfjam --help +.RE +.PP +For further information and some examples see +http://go.warwick.ac.uk/pdfjam \&. +.PP +.SH "LIMITATIONS AND BUGS" +.PP +pdf180 does not work with encrypted PDF files, and does not +preserve hyperlinks. +.PP +Please report bugs! See the website at +http://go.warwick.ac.uk/pdfjam \&. +.PP +.SH "SEE ALSO" +.PP +pdfjam(1)\&. +.PP +.SH "LICENSE" +.PP +PDFjam is distributed under the GNU public license\&. +.PP +.SH "AUTHOR" +.PP +pdf180 is written and maintained by David Firth as part of the PDFjam package\&. + diff -Nru pdfjam-1.20/man1/pdf270.1 pdfjam-2.05/man1/pdf270.1 --- pdfjam-1.20/man1/pdf270.1 1970-01-01 01:00:00.000000000 +0100 +++ pdfjam-2.05/man1/pdf270.1 2010-04-25 16:49:05.000000000 +0100 @@ -0,0 +1,74 @@ +.TH "pdf270" "1" "10 March 2010" "" "" +.SH "NAME" +pdf270 \- rotate the pages of pdf files +.SH "SYNOPSIS" +.PP +pdf270 [OPTION [OPTION] \&.\&.\&.] [SRC [PAGESPEC] [SRC [PAGESPEC]] \&.\&.\&.] +.PP +.SH "DESCRIPTION" +.PP +pdf270 rotates the pages of files in the Adobe Portable Document Format (PDF) +through 90 degrees (clockwise)\&. +.PP +If no source PDF file ('SRC') is specified, input +is from /dev/stdin. If 'PAGESPEC' is omitted, all pages are processed. +.PP +Source files are processed sequentially into a single output +unless the '--batch' option is used, in which case they are processed +separately. +.PP +pdf270 operates on one or more PDF files, and (either with the '--batch' +option or with '--outfile DIR' where 'DIR' is a directory) the +resulting files have +the suffix 'rotated270' applied to their names by default. To change +the suffix, +use the '--suffix' option, for example +.PP +.RS +.B pdf270 --suffix '-turned' --batch myfile1.pdf myfile2.pdf +.RE +.PP +will result in files named 'myfile1-turned.pdf' and 'myfile2-turned.pdf'. +.PP +pdf270 is a simple wrapper for pdfjam, which is a front end to many of the capabilities of the pdfpages +package for pdflatex\&. A working installation of pdflatex with +the pdfpages package is required\&. +.PP +pdf270 is part of the "PDFjam" package of tools, whose homepage is at +http://go.warwick.ac.uk/pdfjam\&. +.PP +.SH "SETUP" +.PP +See http://go.warwick.ac.uk/pdfjam . +.PP +.SH "USAGE" +.PP +For the available options and site/user defaults, see the output of +.PP +.RS + pdfjam --help +.RE +.PP +For further information and some examples see +http://go.warwick.ac.uk/pdfjam . +.PP +.SH "LIMITATIONS AND BUGS" +.PP +pdf270 does not work with encrypted PDF files, and does not +preserve hyperlinks. +.PP +Please report bugs! See the website at +http://go.warwick.ac.uk/pdfjam \&. +.PP +.SH "SEE ALSO" +.PP +pdfjam(1)\&. +.PP +.SH "LICENSE" +.PP +PDFjam is distributed under the GNU public license\&. +.PP +.SH "AUTHOR" +.PP +pdf270 is written and maintained by David Firth as part of the PDFjam package\&. + diff -Nru pdfjam-1.20/man1/pdf90.1 pdfjam-2.05/man1/pdf90.1 --- pdfjam-1.20/man1/pdf90.1 2005-01-18 15:05:03.000000000 +0000 +++ pdfjam-2.05/man1/pdf90.1 2010-04-25 16:49:22.000000000 +0100 @@ -1,51 +1,56 @@ -.TH "pdf90" "1" "18 Jan 2005" "" "" +.TH "pdf90" "1" "10 March 2010" "" "" .SH "NAME" pdf90 \- rotate the pages of pdf files .SH "SYNOPSIS" .PP -pdf90 [OPTION]\&.\&.\&. SRC [SRC]\&.\&.\&. +pdf90 [OPTION [OPTION] \&.\&.\&.] [SRC [PAGESPEC] [SRC [PAGESPEC]] \&.\&.\&.] .PP .SH "DESCRIPTION" .PP pdf90 rotates the pages of files in the Adobe Portable Document Format (PDF) through 90 degrees (anti-clockwise)\&. +.PP +If no source PDF file ('SRC') is specified, input +is from /dev/stdin. If 'PAGESPEC' is omitted, all pages are processed. +.PP +Source files are processed sequentially into a single output +unless the '--batch' option is used, in which case they are processed +separately. +.PP +pdf90 operates on one or more PDF files, and (either with the '--batch' +option or with '--outfile DIR' where 'DIR' is a directory) the +resulting files have +the suffix 'rotated90' applied to their names by default. To change +the suffix, +use the '--suffix' option, for example +.PP +.RS +.B pdf90 --suffix '-turned' --batch myfile1.pdf myfile2.pdf +.RE .PP -pdf90 is a front end to some of the capabilities of the pdfpages +will result in files named 'myfile1-turned.pdf' and 'myfile2-turned.pdf'. +.PP +pdf90 is a simple wrapper for pdfjam, which is a front end to many of the capabilities of the pdfpages package for pdflatex\&. A working installation of pdflatex with the pdfpages package is required\&. .PP pdf90 is part of the "PDFjam" package of tools, whose homepage is at -http://www.warwick.ac.uk/go/pdfjam\&. +http://go.warwick.ac.uk/pdfjam\&. .PP .SH "SETUP" .PP -See http://www.warwick.ac.uk/go/pdfjam, or the file PDFjam-readme.html -included with the PDFjam package. +See http://go.warwick.ac.uk/pdfjam . .PP .SH "USAGE" .PP -For the available options and local/user defaults, see the output of +For the available options and site/user defaults, see the output of .PP .RS - pdf90 --help + pdfjam --help .RE .PP For further information and some examples see -http://www.warwick.ac.uk/go/pdfjam or the file PDFjam-readme.html -included with the PDFjam package\&. -.PP -.SH "CONFIGURATION FILES" -.PP -Configuration of pdf90 involves specifying the location of pdflatex, -the location of temporary files, -etc. This is done in a block of lines at the top of the pdf90 -shell script itself; settings made there are over-ridden by any that -are found at a site-wide configuration file (at /etc/pdfnup.conf, -/usr/share/etc/pdfnup.conf, /usr/local/share/pdfnup.conf, or -/usr/local/etc/pdfnup.conf) -which -in turn are over-ridden by any that are found in a user-defaults -file at ~/.pdfnup.conf\&. +http://go.warwick.ac.uk/pdfjam . .PP .SH "LIMITATIONS AND BUGS" .PP @@ -53,12 +58,15 @@ preserve hyperlinks. .PP Please report bugs! See the website at -http://www.warwick.ac.uk/go/pdfjam\&. +http://go.warwick.ac.uk/pdfjam \&. +.PP +.SH "SEE ALSO" +.PP +pdfjam(1)\&. .PP .SH "LICENSE" .PP -PDFjam is distributed under the GNU public license\&. See the file -COPYING for details\&. +PDFjam is distributed under the GNU public license\&. .PP .SH "AUTHOR" .PP diff -Nru pdfjam-1.20/man1/pdfbook.1 pdfjam-2.05/man1/pdfbook.1 --- pdfjam-1.20/man1/pdfbook.1 1970-01-01 01:00:00.000000000 +0100 +++ pdfjam-2.05/man1/pdfbook.1 2010-04-25 16:44:19.000000000 +0100 @@ -0,0 +1,83 @@ +.TH "pdfbook" "1" "10 March 2010" "" "" +.SH "NAME" +pdfbook \- put the pages of PDF files into 2-up signatures +.SH "SYNOPSIS" +.PP +pdfbook [--short-edge] [OPTION [OPTION] \&.\&.\&.] [SRC [PAGESPEC] [SRC [PAGESPEC]] \&.\&.\&.] +.PP +.SH "DESCRIPTION" +.PP +pdfbook makes 2-up versions of PDF files, with the pages ordered as +signatures. The default signature size is 4: to change this, use the +option '--signature N', where N is a multiple of 4 (alternatively use '--signature* N' for +right-edge binding). +.PP +The default is to make pages suitable for long-edge binding. For short-edge +binding, use '--short-edge' as the first argument; this will only work if the LaTeX package 'everyshi' is installed. +.PP +The default output page orientation is +landscape. To change this, use the '--no-landscape' option. +.PP +If no source PDF file ('SRC') is specified, input +is from /dev/stdin. If 'PAGESPEC' is omitted, all pages are processed. +.PP +Source files are processed sequentially into a single output +unless the '--batch' option is used, in which case they are processed +separately. +.PP +pdfbook is a simple wrapper for pdfjam, which provides a front end to +many of the capabilities of the pdfpages +package for pdflatex\&. A working installation of pdflatex, with +the pdfpages package, is required\&. +.PP +pdfbook operates on one or more PDF files, and (either with the '--batch' +option or with '--outfile DIR' where 'DIR' is a directory) the +resulting files have +the suffix '-book' applied to their names by default. To change the suffix, +use the '--suffix' option, for example +.PP +.RS +.B pdfbook --suffix 'sig4' --batch myfile1.pdf myfile2.pdf +.RE +.PP +will result in files named 'myfile1-sig4.pdf' and 'myfile2-sig4.pdf'. +.PP +pdfbook is part of the "PDFjam" package of tools, whose homepage is at +http://www.warwick.ac.uk/go/pdfjam\&. +.PP +.SH "SETUP" +.PP +See http://go.warwick.ac.uk/pdfjam . +.PP +.SH "USAGE" +.PP +For the other available options and +site/user defaults, see the output of +.PP +.RS +.B pdfjam --help +.RE +.PP +For further information and some examples see +http://go.warwick.ac.uk/pdfjam . +.PP +.SH "LIMITATIONS AND BUGS" +.PP +pdfbook does not work with encrypted PDF files, and does not +preserve hyperlinks. +.PP +Please report bugs! See the website at +http://www.warwick.ac.uk/go/pdfjam \&. +.PP +.SH "LICENSE" +.PP +PDFjam is distributed under the GNU public license\&. +.PP +.SH "SEE ALSO" +.PP +pdfjam(1)\&. +.PP +.SH "AUTHOR" +.PP +pdfbook is written and maintained by David Firth as part of the PDFjam package\&. + diff -Nru pdfjam-1.20/man1/pdfflip.1 pdfjam-2.05/man1/pdfflip.1 --- pdfjam-1.20/man1/pdfflip.1 1970-01-01 01:00:00.000000000 +0100 +++ pdfjam-2.05/man1/pdfflip.1 2010-04-25 16:46:38.000000000 +0100 @@ -0,0 +1,73 @@ +.TH "pdfflip" "1" "10 March 2010" "" "" +.SH "NAME" +pdfflip \- rotate the pages of pdf files +.SH "SYNOPSIS" +.PP +pdfflip [OPTION [OPTION] \&.\&.\&.] [SRC [PAGESPEC] [SRC [PAGESPEC]] \&.\&.\&.] +.PP +.SH "DESCRIPTION" +.PP +pdfflip reflects (left-right) the pages of files in the Adobe Portable Document Format (PDF)\&. +.PP +If no source PDF file ('SRC') is specified, input +is from /dev/stdin. If 'PAGESPEC' is omitted, all pages are processed. +.PP +Source files are processed sequentially into a single output +unless the '--batch' option is used, in which case they are processed +separately. +.PP +pdfflip operates on one or more PDF files, and (either with the '--batch' +option or with '--outfile DIR' where 'DIR' is a directory) the +resulting files have +the suffix '-flipped' applied to their names by default. To change +the suffix, +use the '--suffix' option, for example +.PP +.RS +.B pdfflip --suffix 'reflected' --batch myfile1.pdf myfile2.pdf +.RE +.PP +will result in files named 'myfile1-reflected.pdf' and 'myfile2-reflected.pdf'. +.PP +pdfflip is a simple wrapper for pdfjam, which is a front end to many of the capabilities of the pdfpages +package for pdflatex\&. A working installation of pdflatex with +the pdfpages package is required\&. +.PP +pdfflip is part of the "PDFjam" package of tools, whose homepage is at +http://go.warwick.ac.uk/pdfjam\&. +.PP +.SH "SETUP" +.PP +See http://go.warwick.ac.uk/pdfjam . +.PP +.SH "USAGE" +.PP +For the available options and site/user defaults, see the output of +.PP +.RS + pdfjam --help +.RE +.PP +For further information and some examples see +http://go.warwick.ac.uk/pdfjam . +.PP +.SH "LIMITATIONS AND BUGS" +.PP +pdfflip does not work with encrypted PDF files, and does not +preserve hyperlinks. +.PP +Please report bugs! See the website at +http://go.warwick.ac.uk/pdfjam \&. +.PP +.SH "SEE ALSO" +.PP +pdfjam(1)\&. +.PP +.SH "LICENSE" +.PP +PDFjam is distributed under the GNU public license\&. +.PP +.SH "AUTHOR" +.PP +pdfflip is written and maintained by David Firth as part of the PDFjam package\&. + diff -Nru pdfjam-1.20/man1/pdfjam.1 pdfjam-2.05/man1/pdfjam.1 --- pdfjam-1.20/man1/pdfjam.1 1970-01-01 01:00:00.000000000 +0100 +++ pdfjam-2.05/man1/pdfjam.1 2010-05-28 14:36:17.000000000 +0100 @@ -0,0 +1,307 @@ +.TH "pdfjam" "1" "10 March 2010" "" "" +.SH "NAME" +pdfjam \- A shell script for manipulating PDF files +.SH "SYNOPSIS" +.PP +pdfjam [\fIOPTIONS\fR] [\fI--\fR] [\fIFILE1 \fR[\fISEL1\fR]] [\fIFILE2 \fR[\fISEL2\fR]]... +.PP +.SH "DESCRIPTION" +.PP +pdfjam provides a front end to most capabilities of the +"pdfpages" package (by Andreas Matthias) of pdflatex. +Detailed information can be found via +"pdfjam --help", and also in the web page mentioned below \&. +.PP +A working installation of pdflatex, with +the pdfpages package, is required\&. +.PP +The pdfjam script is distributed as (the main) part of the PDFjam package. The homepage of PDFjam is at +http://go.warwick.ac.uk/pdfjam \&. +.SH USAGE +.PP +\'FILE1' etc. in the example above are PDF files. For input from /dev/stdin, use the special name +.IP +\&'/dev/stdin' in place of any of FILE1, FILE2, etc: this can be mixed with +\&'real' files as needed, to allow PDF data to be input through a pipe (note +that if /dev/stdin is connected to tty, an error results). If 'FILE1' is +absent, pdfjam will use '/dev/stdin' (and will use '\-' for the page +selection \fB\-\-\fR see next item). +.PP +\'SEL1' is a page selection for FILE1, etc. +To select all pages (the default) use '\-'. + +See the pdfpages manual for more details. +An example: + +\&... file1 '{},2,4\-5,9\-' ... + +makes an empty page, followed by pages 2,4,5,6 of file1, followed by pages +9 onwards (up to the end of file1). +A page selection can be applied to more than one file, e.g., + +\&... file1 file2 file3 1\-7 ... + +applies page selection '1\-7' to all three files; but for example + +\&... file1 file2 2\- file3 1\-7 ... + +would apply the page selection '2\-' to file1 and file2, and '1\-7' +to file3. A page selection applies to all the files *immediately* +preceding it in the argument list. A missing page selection defaults to +\&'\-'; this includes the case where 'FILE1' is absent and so /dev/stdin gets +used by default. 'options' are pdfpages specifications in the form '\-\-KEY VALUE' (see +below), or +.TP +\fB\-\-help\fR +(or \fB\-h\fR, or \fB\-u\fR) +.IP +Output this text only; no processing of PDF files. +.HP +\fB\-\-configpath\fR +.IP +Output the 'configpath' variable and exit immediately; no +processing of PDF files. +.TP +\fB\-\-quiet\fR +(or \fB\-q\fR) +.IP +Suppress verbose commentary on progress. +.HP +\fB\-\-batch\fR +.IP +Run pdfjam sequentially on each input file in turn, and +produce a separate output file for each input, rather +than the default behaviour (which is a single run of +pdfjam on all of the input files, producing a single +output document). For the location of output +files, see '\-\-outfile'. The \fB\-\-batch\fR option cannot be +used in the case of input fron stdin. +.TP +\fB\-\-outfile\fR PATH +(or \fB\-o\fR PATH) +.IP +Specifies where the output file(s) will go. If PATH is an +existing directory, pdfjam will attempt to write its +output PDF file(s) there, with name(s) derived from the +input file name(s) and the \fB\-\-suffix\fR option (see below). +Otherwise the output file will be PATH. If '/dev/stdin' +is the only or last input file, PATH cannot be a directory. +Your current default PATH for output is: +/home/ed/debian/dev/pdfjam +.HP +\fB\-\-suffix\fR STRING +.IP +Specifies a suffix for output file names, to be used when +\fB\-\-outfile\fR is either (a) a directory, or +(b) not specified in a \fB\-\-batch\fR call. +.IP +A good STRING should be descriptive: for example, +.IP +\fB\-\-suffix\fR 'rotated' +.IP +would append the text '\-rotated' to the name of the input +file in order to make the output file name, as in +\&'myfile\-rotated.pdf'. The STRING must not have zero +length. +[Default for you at this site: suffix=pdfjam] +.HP +\fB\-\-checkfiles\fR +.HP +\fB\-\-no\-checkfiles\fR +.IP +If the Unix 'file' utility is available, with options +\fB\-L\fR and \fB\-b\fR, the output of 'file \fB\-Lb\fR FILE1' should be +\&'PDF document...' where '...' gives version information. +If this is the case on your system you should use +\&'\-\-checkfiles'; otherwise use '\-\-no\-checkfiles', +in which case all input PDF files must have .pdf or .PDF +as their name extension. +[Default for you at this site: checkfiles=false] +.HP +\fB\-\-preamble\fR STRING +.IP +Append the supplied STRING to the preamble of the LaTeX +source file(s), immediately before the '\ebegin{document}' +line. An example: +.IP +pdfjam \fB\-\-nup\fR 2x2 myfile.pdf \fB\-o\fR myfile\-4up.pdf \e +.IP +\fB\-\-preamble\fR '\eusepackage{fancyhdr} \epagestyle{fancy}' +.IP +The \fB\-\-preamble\fR option can be used, for example, to load LaTeX +packages and/or to set global options. +.HP +\fB\-\-keepinfo\fR +.HP +\fB\-\-no\-keepinfo\fR +.IP +Preserve (or not) Title, Author, Subject and Keywords +(from the last input PDF file, if more than one) in the +output PDF file. This requires the pdfinfo utility, from +the xpdf package, and the LaTeX 'hyperref' package; if +either of those is not available, '\-\-keepinfo' is ignored. +[Default for you at this site: keepinfo=false] +.HP +\fB\-\-pdftitle\fR STRING +.HP +\fB\-\-pdfauthor\fR STRING +.HP +\fB\-\-pdfsubject\fR STRING +.HP +\fB\-\-pdfkeywords\fR STRING +.IP +Provide text for the Title, Author, Subject and Keywords in the output PDF file. Requires the LaTeX 'hyperref' +package. +These options, individually, over\-ride \fB\-\-keepinfo\fR. +.HP +\fB\-\-landscape\fR +.HP +\fB\-\-no\-landscape\fR +.IP +Specify landscape page orientation (or not) in the +output PDF file. +[Default for you at this site: landscape=] +.HP +\fB\-\-twoside\fR +.HP +\fB\-\-no\-twoside\fR +.IP +Specify (or not) the 'twoside' document class option. +[Default for you at this site: twoside=] +.TP +\fB\-\-paper\fR PAPERSPEC +(or simply \fB\-\-PAPERSPEC\fR) +.IP +Specify a LaTeX paper size, for example +\&'\-\-paper a4paper' or simply '\-\-a4paper' for ISO A4 paper. +If the LaTeX 'geometry' package is installed, a wider range +of paper sizes is available. For details see documentation +for LaTeX and/or the 'geometry' package. +[Default for you at this site: paper=a4paper] +.HP +\fB\-\-papersize\fR '{WIDTH,HEIGHT}' +.IP +Specify a custom paper size, e.g., +.IP +\fB\-\-papersize\fR '{10in,18cm}' +.IP +(Note the braces, and the comma!) +If the 'geometry' package is not found, this has no effect. +.HP +\fB\-\-pagecolor\fR RGBSPEC +.IP +Specify a background colour for the output pages. +The +RGBSPEC must be a comma\-separated trio of integers +between 0 and 255. An example: +.IP +\fB\-\-pagecolor\fR 150,200,150 +.IP +[Default is no background colour] +.HP +\fB\-\-tidy\fR +.HP +\fB\-\-no\-tidy\fR +.IP +Specify whether the temporary directory created by +pdfjam should be deleted. Use '\-\-no\-tidy' to help debug +most errors. +[Default for you at this site: tidy=true] +.HP +\fB\-\-vanilla\fR +.IP +Suppress the reading of any site\-wide or user\-specific +configuration files. +.HP +\fB\-\-KEY\fR VALUE +.IP +Specify options to '\eincludepdfmerge', in the LaTeX +\&'pdfpages' package. Here KEY is the name of any of the +many options for '\eincludepdfmerge', and VALUE is a +corresponding value. Examples are: +.TP +\fB\-\-nup\fR 2x1 +(for 2\-up side\-by\-side imposition) +.TP +\fB\-\-scale\fR 0.7 +(to scale all input pages to 70% size) +.IP +\fB\-\-offset\fR '1cm 0.5cm' +.IP +(to offset all pages \fB\-\-\fR note the quotes!) +.TP +\fB\-\-frame\fR true +(to put a frame round each input page) +.IP +\fB\-\-trim\fR '1cm 2cm 1cm 2cm' \fB\-\-clip\fR true +.IP +(to trim those amounts from left, bottom, +.IP +right and top, respectively, of input +pages) +.TP +etc., etc. +For more information see the manual for +.IP +the 'pdfpages' package, at +http://www.ctan.org/tex\-archive/macros/latex/contrib/pdfpages +.PP +Argument '\-\-' can be used to signal that there are no more options to come. +.PP +Defaults for the options '\-\-suffix', '\-\-keepinfo', '\-\-paper', '\-\-outfile', +\&'\-\-landscape', '\-\-twoside', '\-\-tidy' and '\-\-checkfiles' can be set in +site\-wide or user\-specific configuration files. The path that is searched +for site\-wide configuration files (named pdfjam.conf) at this installation is +.IP +/etc:/usr/share/etc:/usr/local/share:/usr/local/etc +.PP +This configuration path can be changed by editing the pdfjam script if +necessary. Any user\-specific configuration should be put in a file named +\&.pdfjam.conf in your home directory. (All of these files are ignored +if the '\-\-vanilla' argument is used.) +.PP +For more information, including an example configuration file, see +http://go.warwick.ac.uk/pdfjam. + + +.PP +.SH "SETUP" +.PP +See http://go.warwick.ac.uk/pdfjam . +.PP +.PP +For further information and some examples see +http://go.warwick.ac.uk/pdfjam \&. +.PP +.SH "CONFIGURATION FILES" +.PP +Configuration of the PDFjam utilities +involves specifying the location of pdflatex, +the location of temporary files, specification of default page size, +etc. This is done in a block of lines near the top of the pdfjam script; +settings made there are over-ridden by any that +are found at a site-wide configuration file +(at /etc/pdfjam.conf, +/usr/share/etc/pdfjam.conf, /usr/local/share/pdfjam.conf, or +/usr/local/etc/pdfjam.conf), which +in turn are over-ridden by any that are found in a user-defaults +file at ~/.pdfjam.conf\&. +.PP +.SH "LIMITATIONS AND BUGS" +.PP +pdfjam does not work with encrypted PDF files, and does not +preserve hyperlinks. +.PP +Please report bugs! See the website at +http://go.warwick.ac.uk/pdfjam \&. +.PP +.SH "LICENSE" +.PP +PDFjam is distributed under the GNU public license\&. +.PP +.SH "AUTHOR" +.PP +The PDFjam package is written and maintained by David Firth\&. + +The USAGE chapter was inserted by Eduard Bloch using pdfjam +output processed with help2man and with manual corrections applied. diff -Nru pdfjam-1.20/man1/pdfjam-pocketmod.1 pdfjam-2.05/man1/pdfjam-pocketmod.1 --- pdfjam-1.20/man1/pdfjam-pocketmod.1 1970-01-01 01:00:00.000000000 +0100 +++ pdfjam-2.05/man1/pdfjam-pocketmod.1 2010-04-25 16:48:25.000000000 +0100 @@ -0,0 +1,63 @@ +.TH "pdfjam-pocketmod" "1" "10 March 2010" "" "" +.SH "NAME" +pdfjam-pocketmod +\- make an 8-page PDF document into a pocket-sized booklet +.SH "SYNOPSIS" +.PP +.B pdfjam-pocketmod SRC [PAGESPEC] [OPTION [OPTION] \&.\&.\&.] +.PP +.SH "DESCRIPTION" +.PP +pdfjam-pocketmod converts 8 pages of a PDF file into a single 8-up page, with pages ordered and oriented for folding into pocket-sized booklet +( as described at http://repocketmod.com/ )\&. +.PP +SRC must be a regular PDF file (not /dev/stdin). +.PP +If PAGESPEC is omitted, the first 8 pages are processed. +.PP +OPTION is any option to pdfjam(1) other than --batch. +.PP +pdfjam-pocketmod is a simple wrapper for pdfjam, which provides a front end to some of the capabilities of the pdfpages +package for pdflatex\&. A working installation of pdflatex, with +the pdfpages package, is required\&. +.PP +pdfjam-pocketmod is part of the "PDFjam" package of tools, whose homepage is at +http://go.warwick.ac.uk/pdfjam \&. +.PP +.SH "SETUP" +.PP +See http://go.warwick.ac.uk/pdfjam . +.PP +.SH "USAGE" +.PP +For the available options and site/user defaults, see the output of +.PP +.RS +.B pdfjam --help +.RE +.PP +For further information and some examples see +http://go.warwick.ac.uk/pdfjam \&. +.PP +.SH "LIMITATIONS AND BUGS" +.PP +pdfjam-pocketmod does not work with encrypted PDF files, and does not preserve hyperlinks. +.PP +The '--keepinfo' option does not work. +.PP +Please report bugs! See the website at +http://www.warwick.ac.uk/go/pdfjam\&. +.PP +.SH "LICENSE" +.PP +PDFjam is distributed under the GNU public license\&. +.PP +.SH "SEE ALSO" +.PP +pdfjam(1)\&. +.PP +.SH "AUTHOR" +.PP +pdfjam-pocketmod is written and maintained by David Firth as part of the PDFjam +package\&. + diff -Nru pdfjam-1.20/man1/pdfjam-slides3up.1 pdfjam-2.05/man1/pdfjam-slides3up.1 --- pdfjam-1.20/man1/pdfjam-slides3up.1 1970-01-01 01:00:00.000000000 +0100 +++ pdfjam-2.05/man1/pdfjam-slides3up.1 2010-04-25 16:51:03.000000000 +0100 @@ -0,0 +1,88 @@ +.TH "pdfjam-slides3up" "1" "10 March 2010" "" "" +.SH "NAME" +pdfjam-slides3up \- put presentation slides onto 3-up pages +.SH "SYNOPSIS" +.PP +pdfjam-slides3up [--pagenumbering SWITCH] [OPTION [OPTION] \&.\&.\&.] [SRC [PAGESPEC] [SRC [PAGESPEC]] \&.\&.\&.] +.PP +.SH "DESCRIPTION" +.PP +pdfjam-slides3up converts PDF files whose pages are presentation slides (with +4:3 aspect ratio) into 3-up versions suitable for making a handout with space +for handwritten side notes +(for example). By default, the 3-up pages do not themselves have page numbers. +.PP +To put page numbers on the output pages, use either '--pagenumbering true' +or, for example, '--pagenumbering 3.4cm' to place the page numbers a bit +lower on the page than the default position. The value of 'SWITCH' must +be either 'true', 'false' or a dimension that can be used by LateX. (To +be precise, it's the value of the 'footskip' dimension in LaTeX; by default, +pdfjam-slides3up sets that as 3.1cm, which works pretty well in +conjunction with both '--paper a4paper' and '--paper letterpaper'.) +.PP +If no source PDF file ('SRC') is specified, input +is from /dev/stdin. If 'PAGESPEC' is omitted, all pages are processed. +.PP +Source files are processed sequentially into a single output +unless the '--batch' option is used, in which case they are processed +separately. +.PP +pdfjam-slides3up is a simple wrapper for pdfjam, which provides a front end to +many of the capabilities of the pdfpages +package for pdflatex\&. A working installation of pdflatex, with +the pdfpages package, is required\&. +.PP +pdfjam-slides3up operates on one or more PDF files, and (either with +the '--batch' option or with '--outfile DIR' where 'DIR' is a directory) the +resulting files have +the suffix '-3up' applied to their names by default. To change the suffix, +use the '--suffix' option, for example +.PP +.RS +.B pdfjam-slides3up --suffix '1x3' --batch myslides1.pdf myslides2.pdf +.RE +.PP +will result in files named 'myslides1-1x3.pdf' and 'myslides2-1x3.pdf'. +.PP +By default a narrow line frame is printed around every slide. This can be +turned off if required by using the option '--frame false'. +.PP +pdfjam-slides3up is part of the "PDFjam" package of tools, whose homepage is at +http://www.warwick.ac.uk/go/pdfjam \&. +.PP +.SH "SETUP" +.PP +See http://go.warwick.ac.uk/pdfjam . +.PP +.SH "USAGE" +.PP +For the other available options and +site /user defaults, see the output of +.PP +.RS +.B pdfjam --help +.RE +.PP +For further information and some examples see +http://go.warwick.ac.uk/pdfjam \&. +.PP +.SH "LIMITATIONS AND BUGS" +.PP +pdfjam-slides3up does not work with encrypted PDF files, and does not +preserve hyperlinks. +.PP +Please report bugs! See the website at +http://www.warwick.ac.uk/go/pdfjam \&. +.PP +.SH "LICENSE" +.PP +PDFjam is distributed under the GNU public license\&. +.PP +.SH "SEE ALSO" +.PP +pdfjam(1) pdfjam-slides6up(1) \&. +.PP +.SH "AUTHOR" +.PP +pdfjam-slides3up is written and maintained by David Firth as part of the PDFjam package\&. + diff -Nru pdfjam-1.20/man1/pdfjam-slides6up.1 pdfjam-2.05/man1/pdfjam-slides6up.1 --- pdfjam-1.20/man1/pdfjam-slides6up.1 1970-01-01 01:00:00.000000000 +0100 +++ pdfjam-2.05/man1/pdfjam-slides6up.1 2010-04-25 16:51:17.000000000 +0100 @@ -0,0 +1,87 @@ +.TH "pdfjam-slides6up" "1" "10 March 2010" "" "" +.SH "NAME" +pdfjam-slides6up \- put presentation slides onto 6-up pages +.SH "SYNOPSIS" +.PP +pdfjam-slides6up [--pagenumbering SWITCH] [OPTION [OPTION] \&.\&.\&.] [SRC [PAGESPEC] [SRC [PAGESPEC]] \&.\&.\&.] +.PP +.SH "DESCRIPTION" +.PP +pdfjam-slides6up converts PDF files whose pages are presentation slides (with +4:3 aspect ratio) into 6-up versions suitable for making a handout +(for example). By default, the 6-up pages do not themselves have page numbers. +.PP +To put page numbers on the output pages, use either '--pagenumbering true' +or, for example, '--pagenumbering 3.0cm' to place the page numbers a bit +lower on the page than the default position. The value of 'SWITCH' must +be either 'true', 'false' or a dimension that can be used by LateX. (To +be precise, it's the value of the 'footskip' dimension in LaTeX; by default, +pdfjam-slides6up sets that as 2.7cm, which works pretty well in +conjunction with both '--paper a4paper' and '--paper letterpaper'.) +.PP +If no source PDF file ('SRC') is specified, input +is from /dev/stdin. If 'PAGESPEC' is omitted, all pages are processed. +.PP +Source files are processed sequentially into a single output +unless the '--batch' option is used, in which case they are processed +separately. +.PP +pdfjam-slides6up is a simple wrapper for pdfjam, which provides a front end to +many of the capabilities of the pdfpages +package for pdflatex\&. A working installation of pdflatex, with +the pdfpages package, is required\&. +.PP +pdfjam-slides6up operates on one or more PDF files, and (either with +the '--batch' option or with '--outfile DIR' where 'DIR' is a directory) the +resulting files have +the suffix '-6up' applied to their names by default. To change the suffix, +use the '--suffix' option, for example +.PP +.RS +.B pdfjam-slides6up --suffix '2x3' --batch myslides1.pdf myslides2.pdf +.RE +.PP +will result in files named 'myslides1-2x3.pdf' and 'myslides2-2x3.pdf'. +.PP +By default a narrow line frame is printed around every slide. This can be +turned off if required by using the option '--frame false'. +.PP +pdfjam-slides6up is part of the "PDFjam" package of tools, whose homepage is at +http://www.warwick.ac.uk/go/pdfjam \&. +.PP +.SH "SETUP" +.PP +See http://go.warwick.ac.uk/pdfjam . +.PP +.SH "USAGE" +.PP +For the other available options and +site/user defaults, see the output of +.PP +.RS +.B pdfjam --help +.RE +.PP +For further information and some examples see +http://go.warwick.ac.uk/pdfjam \&. +.PP +.SH "LIMITATIONS AND BUGS" +.PP +pdfjam-slides6up does not work with encrypted PDF files, and does not +preserve hyperlinks. +.PP +Please report bugs! See the website at +http://www.warwick.ac.uk/go/pdfjam \&. +.PP +.SH "LICENSE" +.PP +PDFjam is distributed under the GNU public license\&. +.PP +.SH "SEE ALSO" +.PP +pdfjam(1) pdfjam-slides3up(1) \&. +.PP +.SH "AUTHOR" +.PP +pdfjam-slides6up is written and maintained by David Firth as part of the PDFjam package\&. + diff -Nru pdfjam-1.20/man1/pdfjoin.1 pdfjam-2.05/man1/pdfjoin.1 --- pdfjam-1.20/man1/pdfjoin.1 2005-01-18 15:10:13.000000000 +0000 +++ pdfjam-2.05/man1/pdfjoin.1 2010-03-17 09:31:44.000000000 +0000 @@ -1,68 +1,63 @@ -.TH "pdfjoin" "1" "18 Jan 2005" "" "" +.TH "pdfjoin" "1" "10 March 2010" "" "" .SH "NAME" pdfjoin -\- join together multiple PDF files +\- join together pages from multiple PDF files .SH "SYNOPSIS" .PP -.B pdfjoin -[OPTION]\&.\&.\&. SRC [SRC]\&.\&.\&. +.B pdfjoin [OPTION [OPTION] \&.\&.\&.] [SRC [PAGESPEC] [SRC [PAGESPEC]] \&.\&.\&.] .PP .SH "DESCRIPTION" .PP pdfjoin concatenates the pages of multiple Portable Document Format (PDF) -files together into a single file\&. -.PP -pdfjoin is a front end to some of the capabilities of the pdfpages -package for pdflatex\&. A working installation of pdflatex with -the pdfpages package is required\&. +files together into a single file.\&. +.PP +If no source PDF file ('SRC') is specified, input (but just one file -- not +very useful here! +is from /dev/stdin. If 'PAGESPEC' is omitted, all pages are processed. +.PP +Source files are processed sequentially into a single output. +The '--batch' option of pdfjam(1) cannot be used. +.PP +pdfjoin is a simple wrapper for pdfjam, which provides a front end to many of the capabilities of the pdfpages +package for pdflatex\&. A working installation of pdflatex, with +the pdfpages package, is required\&. .PP pdfjoin is part of the "PDFjam" package of tools, whose homepage is at -http://www.warwick.ac.uk/go/pdfjam\&. +http://go.warwick.ac.uk/pdfjam \&. .PP .SH "SETUP" .PP -See http://www.warwick.ac.uk/go/pdfjam, or the file PDFjam-readme.html -included with the PDFjam package. +See http://go.warwick.ac.uk/pdfjam . .PP .SH "USAGE" .PP -For the available options and local/user defaults, see the output of +For the available options and site/user defaults, see the output of .PP .RS -.B pdfjoin ---help +.B pdfjam --help .RE .PP For further information and some examples see -http://www.warwick.ac.uk/go/pdfjam or the file PDFjam-readme.html -included with the PDFjam package\&. -.PP -.SH "CONFIGURATION FILES" -.PP -Configuration of pdfjoin involves specifying the location of pdflatex, -the location of temporary files, specification of default page size, -etc. This is done in a block of lines at the top of the pdfjoin -shell script itself; settings made there are over-ridden by any that -are found at a site-wide configuration file -(at /etc/pdfnup.conf, -/usr/share/etc/pdfnup.conf, /usr/local/share/pdfnup.conf, or -/usr/local/etc/pdfnup.conf), which -in turn are over-ridden by any that are found in a user-defaults -file at ~/.pdfnup.conf\&. +http://go.warwick.ac.uk/pdfjam \&. .PP .SH "LIMITATIONS AND BUGS" .PP +The pages of the output file will all have the same size and orientation. +.PP pdfjoin does not work with encrypted PDF files, and does not -preserve hyperlinks. +preserve hyperlinks. The output pages are all one size. .PP Please report bugs! See the website at -http://www.warwick.ac.uk/go/pdfjam\&. +http://www.warwick.ac.uk/go/pdfjam \&. .PP .SH "LICENSE" .PP -PDFjam is distributed under the GNU public license\&. See the file -COPYING for details\&. +PDFjam is distributed under the GNU public license\&. +.PP +.SH "SEE ALSO" +.PP +pdfjam(1)\&. .PP .SH "AUTHOR" .PP diff -Nru pdfjam-1.20/man1/pdfnup.1 pdfjam-2.05/man1/pdfnup.1 --- pdfjam-1.20/man1/pdfnup.1 2005-01-18 15:10:33.000000000 +0000 +++ pdfjam-2.05/man1/pdfnup.1 2010-04-25 16:51:59.000000000 +0100 @@ -1,53 +1,60 @@ -.TH "pdfnup" "1" "18 Jan 2005" "" "" +.TH "pdfnup" "1" "10 March 2010" "" "" .SH "NAME" -pdfunp \- n-up the pages of pdf files +pdfnup \- n-up the pages of pdf files .SH "SYNOPSIS" .PP -pdfnup [OPTION]\&.\&.\&. SRC [SRC]\&.\&.\&. +pdfnup [OPTION [OPTION] \&.\&.\&.] [SRC [PAGESPEC] [SRC [PAGESPEC]] \&.\&.\&.] .PP .SH "DESCRIPTION" .PP pdfnup converts files in the Adobe Portable Document Format (PDF) -to "n-up" PDF files, that is, with multiple reduced-size input pages +to "n-up" PDF files, that is, with multiple input pages per output page, for -more economical printing etc\&. +more economical printing etc\&. The default processing is to 2-up +landscape output with no frame around pages, equivalent to using the +options '--nup 2x1 --landscape true --frame false'. +.PP +If no source PDF file ('SRC') is specified, input +is from /dev/stdin. If 'PAGESPEC' is omitted, all pages are processed. +.PP +Source files are processed sequentially into a single output +unless the '--batch' option is used, in which case they are processed +separately. +.PP +pdfnup operates on one or more PDF files, and (either with the '--batch' +option or with '--outfile DIR' where 'DIR' is a directory) the +resulting files have +the suffix '-nup' applied to their names by default. To change +the suffix, +use the '--suffix' option, for example +.PP +.RS +.B pdfnup --nup 2x2 --suffix '2x2' --batch myfile1.pdf myfile2.pdf +.RE +.PP +will result in files named 'myfile1-2x2.pdf' and 'myfile2-2x2.pdf'. .PP -pdfnup is a front end to some of the capabilities of the pdfpages -package for pdflatex\&. A working installation of pdflatex with -the pdfpages package is required\&. +pdfnup is a simple wrapper for pdfjam, which provides a front end to many of the capabilities of the pdfpages +package for pdflatex\&. A working installation of pdflatex, with +the pdfpages and geometry packages, is required\&. .PP pdfnup is part of the "PDFjam" package of tools, whose homepage is at -http://www.warwick.ac.uk/go/pdfjam\&. +http://www.warwick.ac.uk/go/pdfjam \&. .PP .SH "SETUP" .PP -See http://www.warwick.ac.uk/go/pdfjam, or the file PDFjam-readme.html -included with the PDFjam package. +See http://go.warwick.ac.uk/pdfjam . .PP .SH "USAGE" .PP -For the available options and local/user defaults, see the output of +For the available options and site/user defaults, see the output of .PP .RS - pdfnup --help +.B pdfjam --help .RE .PP For further information and some examples see -http://www.warwick.ac.uk/go/pdfjam or the file PDFjam-readme.html -included with the PDFjam package\&. -.PP -.SH "CONFIGURATION FILES" -.PP -Configuration of pdfnup involves specifying the location of pdflatex, -the location of temporary files, specification of default page size, -etc. This is done in a block of lines at the top of the pdfnup -shell script itself; settings made there are over-ridden by any that -are found at a site-wide configuration file -(at /etc/pdfnup.conf, -/usr/share/etc/pdfnup.conf, /usr/local/share/pdfnup.conf, or -/usr/local/etc/pdfnup.conf), which -in turn are over-ridden by any that are found in a user-defaults -file at ~/.pdfnup.conf\&. +http://go.warwick.ac.uk/pdfjam . .PP .SH "LIMITATIONS AND BUGS" .PP @@ -55,12 +62,15 @@ preserve hyperlinks. .PP Please report bugs! See the website at -http://www.warwick.ac.uk/go/pdfjam\&. +http://www.warwick.ac.uk/go/pdfjam \&. .PP .SH "LICENSE" .PP -PDFjam is distributed under the GNU public license\&. See the file -COPYING for details\&. +PDFjam is distributed under the GNU public license\&. +.PP +.SH "SEE ALSO" +.PP +pdfjam(1) pdfpun(1) \&. .PP .SH "AUTHOR" .PP diff -Nru pdfjam-1.20/man1/pdfpun.1 pdfjam-2.05/man1/pdfpun.1 --- pdfjam-1.20/man1/pdfpun.1 1970-01-01 01:00:00.000000000 +0100 +++ pdfjam-2.05/man1/pdfpun.1 2010-04-25 16:47:54.000000000 +0100 @@ -0,0 +1,68 @@ +.TH "pdfpun" "1" "10 March 2010" "" "" +.SH "NAME" +pdfpun \- n-up the pages of a pdf file, with right-to-left ordering +.SH "SYNOPSIS" +.PP +pdfpun SRC [PAGESPEC] --outfile FILENAME [OPTION [OPTION] \&.\&.\&.] +.PP +.SH "DESCRIPTION" +.PP +pdfpun converts a file in the Adobe Portable Document Format (PDF) +to a "n-up" PDF file, that is, with multiple input pages +per output page, for +more economical printing etc\&. The pages are ordered right-to-left in the +output. The default processing is to 2-up +landscape output with no frame around pages, equivalent to using the +options '--nup 2x1 --landscape --frame false'. +.PP +SRC must be a PDF file; '/dev/stdin' can be used for PDF input via a pipeline. +.PP +If PAGESPEC is omitted, all pages are processed (equivalent to '-' as PAGESPEC) +.PP +OPTION is any option of pdfjam(1) other than --batch. +.PP +pdfpun is a simple wrapper for pdfjam, which provides a front end to many +of the capabilities of the pdfpages package for pdflatex\&. +A working installation of pdflatex, with +the pdfpages package, is required\&. +.PP +pdfpun is part of the "PDFjam" package of tools, whose homepage is at +http://www.warwick.ac.uk/go/pdfjam\&. +.PP +.SH "SETUP" +.PP +See http://go.warwick.ac.uk/pdfjam . +.PP +.SH "USAGE" +.PP +For the available options and site/user defaults, see the output of +.PP +.RS +.B pdfjam --help +.RE +.PP +For further information and some examples see +http://go.warwick.ac.uk/pdfjam \&. +.PP +.SH "LIMITATIONS AND BUGS" +.PP +pdfpun does not work with encrypted PDF files, and does not +preserve hyperlinks. +.PP +The '--keepinfo' option does not work. +.PP +Please report bugs! See the website at +http://www.warwick.ac.uk/go/pdfjam \&. +.PP +.SH "LICENSE" +.PP +PDFjam is distributed under the GNU public license\&. +.PP +.SH "SEE ALSO" +.PP +pdfjam(1) pdfnup(1)\&. +.PP +.SH "AUTHOR" +.PP +pdfpun is written and maintained by David Firth as part of the PDFjam package\&. + diff -Nru pdfjam-1.20/pdfjam.conf pdfjam-2.05/pdfjam.conf --- pdfjam-1.20/pdfjam.conf 1970-01-01 01:00:00.000000000 +0100 +++ pdfjam-2.05/pdfjam.conf 2010-04-25 16:14:07.000000000 +0100 @@ -0,0 +1,93 @@ +############################################################### +## +## This is a sample 'pdfjam.conf' file. +## +## Edit lines below (and un-comment them as necessary) to +## override settings made in the 'pdfjam' script itself. +## (As distributed, the settings made in this file are the +## same as those made in the 'pdfjam' script.) +## +## A file in this format can be used site-wide (as a file named +## "pdfjam.conf", in an appropriate location), or for a specific +## user (as "~/.pdfjam.conf"). User-specific settings override +## any site-wide settings. +## +## See 'pdfjam --help' for details, including where to put +## this file; or see the file PDFjam-README.html. +## +############################################################### +## +## UNUSUAL TEX INSTALLATION? +## +## Specify the location of the 'pdflatex' to be used: +# pdflatex='/usr/bin/pdflatex' ## typical unix installation +# pdflatex='/usr/texbin/pdflatex' ## for MacTeX on Mac OS X +# pdflatex='C:/texmf/miktex/bin/pdflatex.exe' ## Windows?? +## +############################################################### +## +## TEMPORARY FILES +## +## Specify the location for temporary files written by pdfjam: +tempfileDir='/var/tmp' ## fairly standard on many unix systems +# tempfileDir='C:/tmp' ## use something like this under Cygwin? +## +## Should temporary files be deleted immediately by default? +tidy='true' ## overridden by '--no-tidy' in the call +# tidy='false' ## the alternative +## +############################################################### +## +## USE OF THE 'PDFINFO' UTILITY +## +## Specify whether pdfjam should, by default, try to run 'pdfinfo' +## to preserve source document information in the output: +keepinfo='false' ## overridden by '--keepinfo' in the call +# keepinfo='true' ## the alternative +## +## Specify the 'pdfinfo' program to be used (if any): +# pdfinfo='/usr/bin/pdfinfo' ## typical unix system +# pdfinfo='/opt/local/bin/pdfinfo' ## Mac OS X with MacPorts +## +############################################################### +## +## USE OF 'file -Lb MYFILE' TO CHECK WHETHER A FILE IS A PDF FILE +## +## Should the '--checkfiles' option be used by default? +checkfiles='false' ## overridden by '--checkfiles' in the call; +# checkfiles='true' ## the alternative +## +############################################################### +## +## DEFAULT PAPER SIZE +## +## Set the default paper size to be used: +paper='a4paper' ## for ISO A4 paper +# paper='letterpaper' ## for 'US letter' paper +## +############################################################### +## +## DEFAULT PATH FOR THE --outfile OPTION +## +outFile="$pwd" ## the obvious default +# outFile="$HOME/Documents" ## (another possibility, perhaps) +# outFile=/dev/stdout ## (for easy pipes) +## +############################################################### +## +## OTHER DEFAULTS +## +## Defaults for some other options: +## +suffix='pdfjam' ## overridden by '--suffix MYSUFFIX' in the call +## +landscape='false' ## overridden by '--landscape' in the call +# landscape='true' ## the alternative +## +twoside='false' ## overridden by '--twoside' in the call +# twoside='true' ## the alternative +## +preamble='' ## concatenate other strings to this by using '--preamble' +## +############################################################### +## END OF FILE: that's all you can configure here! diff -Nru pdfjam-1.20/PDFjam-README.html pdfjam-2.05/PDFjam-README.html --- pdfjam-1.20/PDFjam-README.html 2005-01-25 19:13:19.000000000 +0000 +++ pdfjam-2.05/PDFjam-README.html 2010-04-25 17:42:01.000000000 +0100 @@ -2,318 +2,350 @@ "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd"> PDFjam-README.html + - -

- -This file is kept up to date at -http://www.warwick.ac.uk/go/pdfjam. - -

+

Author: David Firth, http://go.warwick.ac.uk/dfirth

+

This file is kept up to date at http://go.warwick.ac.uk/pdfjam.

+

-

-

Overview

-

PDFjam is a small collection of shell scripts which provide a simple interface to some of the functionality of the excellent pdfpages package (by Andreas Matthias) for pdfLaTeX. At present the utilities available are: +

PDFjam is a small collection of shell scripts which provide a simple interface to much of the functionality of the excellent pdfpages PDF file package (by Andreas Matthias) for pdfLaTeX.

+ +

The main script is named "pdfjam". This is the core of the package.

+ +

All of the other scripts provided in the PDFjam package are optional extras. They are simple wrappers for calls to pdfjam, designed to perform some common tasks such as joining or n-upping PDF files or to illustrate other features; they are not very elaborate, nor are they extensively tested. They are probably best thought of as simple templates that can be used for constructing more elaborate wrapper scripts as required. At present the wrapper scripts distributed in the PDFjam package are:

+
    -
  • -pdfnup, which allows PDF files to be "n-upped" in roughly the way that -psnup does for PostScript files. - -
  • -pdfjoin, which concatenates the pages of multiple PDF files together into a single file
  • -
  • -pdf90, which rotates the pages of one or more PDF files through 90 degrees -(anti-clockwise).
  • +
  • pdfnup, which allows one or more PDF files to be "n-upped" in roughly the way that psnup does for PostScript files. (This was the original motivation: for files that have to be printed, or have to be made available to dozens or hundreds of other people for printing, n-up formatting saves trees!)
  • +
  • pdfpun, similar to pdfnup but arranges the source pages right-to-left on the output page, ie in a format more suitable for right-to-left languages. This script works only on one file at a time. (Thanks to Ido for suggesting this.)
  • +
  • pdfjoin, which combines the pages of multiple PDF files together into a single file.
  • +
  • pdf90, pdf180 and pdf270 which rotate the pages of one or more PDF files.
  • +
  • pdfflip which reflects the pages of one or more PDF files. (Suitable for making transparencies if you want to write on the back of them!)
  • +
  • pdfbook which arranges pages into 2-up "signatures" (like psbook does for PostScript files), suitable for binding into a book. (Many people have suggested that this would be useful — I hope it is!)
  • +
  • pdfjam-pocketmod which converts 8 pages from a single PDF file into a pocket-sized booklet. (Folding instructions here! Thanks to Thomas Nemeth for suggesting this.)
  • +
  • pdfjam-slides6up and pdfjam-slides3up which process PDF presentation slides to six-per-page or three-per-page for handout purposes.
-

-In every case, source files are left unchanged. +

A potential drawback of pdfjam and other scripts based upon it is that any hyperlinks in the source PDF are lost. On the positive side, there is no appreciable degradation of image quality in processing PDF files with these programs, unlike some other indirect methods such as  pdf2ps | psnup | ps2pdf  (in the author's experience).

+ +

These tools are designed for Unix-like systems, including Linux and Mac OS X. It seems that they will work also on Windows computers with a suitable installation of Cygwin (with the Cygwin tetex-extras package installed), but this has not been extensively tested.

+ +

An alternative set of PDF manipulation tools, which are java-based, is provided by the Multivalent project. They do much the same things as pdfjam, and quite a bit more. Hyperlinks don't seem to be preserved there either, though, when n-upping a document.

+ +

For Mac OS X, n-up with a more visual interface is provided by PDF Nup Maker. Like pdfjam, this is a front end to pdflatex/pdfpages.

+ +

The PDFjam software is made available free, under GPL version 2 (see the file named COPYING that is included with the package). It comes with ABSOLUTELY NO WARRANTY of fitness for any purpose whatever.

-

-A potential drawback of these utilities is that any -hyperlinks in the source PDF are lost. On the positive side, -there is no appreciable degradation of image quality in processing -PDF files with thse programs, unlike some other indirect methods such as -pdf2ps | psnup | ps2pdf (in the author's experience). -[Better than the rather indirect approach taken here would -be filters that work directly on the PDF code, to produce output files with hyperlinks intact.] - -

-These tools are designed for Unix-like systems, including Mac OS X. I am told that -pdfnup works fine also on Windows computers with MikTeX -and the cygwin unix tools; I know of no reason -why pdfjoin and pdf90 should not also work in that way. - -

-An alternative set of PDF manipulation tools, which are java-based, is provided by the Multivalent project. They do much the same things as PDFjam, and -quite a bit more. Hyperlinks don't seem to be preserved -there either, though, when n-upping a document. -

- -

-For Mac OS X, n-up with a more visual interface is provided by PDF Nup Maker. Like PDFjam, this is a front end to pdflatex/pdfpages. - -

-The PDFjam software is made available free, under GPL version 2 (see the file named -COPYING that is included with the package). It comes -with ABSOLUTELY NO WARRANTY of fitness for any purpose whatever. -

- - -

Pre-requisites

- -
  1. A Unix-like operating system (Linux, Mac OS X, Solaris, -etc.)
  2. -
  3. A working, up-to-date installation of pdfTeX (including pdflatex and -an up-to-date copy of pdftex.def)
  4. -
  5. A working -installation of the LaTeX package pdfpages (version 0.2e or -later)
  6. +

    Pre-requisites

    + +
      +
    1. A Unix-like operating system (Linux, Mac OS X, Solaris, etc.; possibly Cygwin)
    2. +
    3. A working, up-to-date installation of pdfTeX (including pdflatex and an up-to-date copy of pdftex.def)
    4. +
    5. A working installation of the LaTeX package pdfpages (version 0.4f or later)
    - -

    Download

    +

    Some of the options offered by pdfjam also require the LaTeX packages geometry and hyperref.

    + +

    Documentation

    + +

    The primary documentation for pdfjam, and hence for the other scripts that call it, is obtained by

    + +
    +  pdfjam --help
    +
    +

    This gives information on the arguments to pdfjam, and the default settings that apply at your installation. In addition to the arguments that are explicitly documented there, pdfjam provides access to all of the options of the pdfpages package: that's a large number of options, and it's a set of options that might change, so users are referred to the current pdfpages manual PDF file to see what's available.

    + +

    In addition, each of the scripts has a (rather basic) man page. For example,

    + +
    +  man pdfjam-pocketmod
    +
    +

    gives information about usage and other aspects of the pdfjam-pocketmod script.

    + +

    Download

    + +

    PDFjam is a project at freshmeat: please subscribe there to receive update announcements. Download the shell scripts as pdfjam_latest.tgz.

    + +

    (If for some reason you don't want the latest version, you can still get older versions. Since version 2.00 the URLs are all of the form http://go.warwick.ac.uk/pdfjam/pdfjam_VN.tgz, with "VN" representing the version number. So "VN" could be 2.00, 2.01, 2.02, 2.03 or 2.04; from PDFjam version 2.05 onwards, the dot will be omitted from the file name, so "VN" will be 205, 206, etc.)

    + +

    Various people have kindly packaged PDFjam for distribution in other ways (and perhaps there are some not listed here?):

    + + + +

    To download some stand-alone Mac OS X droplets (based on PDFjam version 1.21), see below.

    + +

    Installation/configuration

    -

    Download the shell scripts -as pdfjam_1.20.tgz. -

    +

    The shell scripts in the bin sub-directory of the package should be placed on the PATH of anyone who needs to use them.

    -

    -Bernhard Walle has kindly made available an RPM package for Linux. -

    +

    The man files in the man1 sub-directory should be installed on the MANPATH of all who need to read them.

    -

    -For Mac OS X droplets, see below. -

    +

    On many unix-like systems the scripts should run without any further configuration, provided that the pre-requisite TeX installation is present. If you want to check (e.g., prior to installation) that pdfjam will work on your system, please unzip the tests sub-directory of the package and follow the instructions that appear in tests/README-tests.txt.

    -

    -PDFjam is a project at freshmeat: please subscribe there to receive update announcements. +

    If configuration is needed, this can be done through a site-wide or user-specific configuration file. This might be necessary if, for example, your site has a non-standard TeX installation, or a non-standard location for temporary files, or a paper size that is different from the A4 international standard.

    - -

    Installation/configuration

    +

    The file pdfjam.conf is a sample configuration file which can be edited as needed. After editing, either install the file for site-wide use (at /etc/pdfjam.conf, /usr/share/etc/pdfjam.conf, /usr/local/share/pdfjam.conf, or /usr/local/etc/pdfjam.conf) or as a user-defaults file at ~/.pdfjam.conf. User settings made at ~/.pdfjam.conf override corresponding settings made in a site-wide configuration file.

    -

    -Look at the small block of lines flagged CONFIGURATION in each of the scripts. -The main requirement is to provide the correct path to pdflatex -on your system. If pdflatex is in your search path (as it ought to be), -no change should be needed. Also set here are defaults for paper size etc. These settings can -be changed by editing the scripts themselves, or (better) by putting them in -a site-configuration file (at /etc/pdfnup.conf, - /usr/share/etc/pdfnup.conf, - /usr/local/share/pdfnup.conf, or - /usr/local/etc/pdfnup.conf) and/or a user-defaults -file ~/.pdfnup.conf to be read in that order when any of pdfnup, pdfjoin or pdf90 -runs (if present these configuration files will override corresponding settings found in the -scripts themselves). -

    +

    For example, if you want your own output to be on "US letter" size paper by default, simply put the line

    -

    -Make sure that the scripts are executable by all who might need to -execute it. If they are to be available to all users on your system, perhaps move -them to /usr/local/bin (or make symbolic links to them there). The -man pages should be installed on the MANPATH of all who need to read -them. -

    +
    +  paper=letterpaper
    +
    +

    in a plain text file named file .pdfnup.conf in your home directory. (The code word letterpaper is how LaTeX refers to that particular page size; for other available paper sizes, please see the output of pdfjam --help.)

    - -

    Using the scripts

    +

    On some systems it might even be necessary to change the list of places (i.e., /etc/pdfjam.conf and others as listed above) that is searched for site-wide configuration files. This can only be done by editing the pdfjam script itself. To see which directories on your system are searched for a file named pdfjam.conf, use

    -

    -Once the scripts are installed, help on usage can be obtained by

    -     pdfnup --help
    +  pdfjam --configpath
     
    +

    Using the scripts

    + +

    For a full overview of what pdfjam can do, the importance of the pdfpages manual PDF file cannot be stressed enough! The following examples merely serve as a brief introduction.

    + +

    Example 1

    + +

    Consider converting each of two documents to a side-by-side "2-up" format. Since we want the two documents to be processed separately, we'll use the --batch option:

    +
    -     pdfjoin --help
    +  pdfjam --batch --nup 2x1 --suffix 2up --landscape --outfile . file1.pdf file2.pdf
     
    +

    This will produce new files file1-2up.pdf and file2-2up.pdf in the current working directory. The above call could be shortened a bit, by using pdfnup, to

    +
    -     pdf90 --help
    +  pdfnup --batch --suffix 2up file1.pdf file2.pdf
     
    -

    +

    In a 'vanilla' installation of pdfjam, the default for --outfile is the current working directory.

    -

    Some examples:

    +

    Example 2

    + +

    Suppose we want a single new document which puts together selected pages from two different files:

    -

    -For pdfnup,

    -     pdfnup mywork/wasteful.pdf --nup 2x2
    +  pdfjam file1.pdf '{},2-' file2.pdf '10,3-6' --outfile ../myNewFile.pdf
     
    -will produce a new 4-up file wasteful-2x2.pdf in directory mywork , and +

    The new file myNewFile.pdf, in the parent directory of the current one, contains an empty page, followed by all pages of file1.pdf except the first, followed by pages 10, 3, 4, 5 and 6 from file2.pdf.

    + +

    The resulting PDF page size will be whatever is the default paper size for you at your site. If instead you want to preserve the page size of (the first included page from) file1.pdf, use the option --fitpaper true: this is the default action of the pdfjoin convenience script.

    + +

    (All pages in an output file from pdfjam will have the same size and orientation: for joining together PDF files while preserving different page sizes and orientations, pdfjam is not the tool to use; and since pdfjoin simply calls pdfjam, the same comment applies also to pdfjoin. I'm told that if you have Ghostscript installed, something along these lines might more nicely join files with different page sizes and orientations:

    +
    -     pdfnup mywork/wasteful.pdf --nup 2x1 --outfile mywork2/halfthewaste.pdf
    +  gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=finished.pdf file1.pdf file2.pdf
     
    -produces a 2-up file halfthewaste.pdf in directory mywork2. -The source pdf file wasteful.pdf is left unchanged. -

    +

    But I haven't tried it.)

    + +

    Example 3

    + +

    To make a portrait-oriented 4-up file from the pages of three input files, with a thin-line frame around the input pages,

    -

    -   pdfnup file1.pdf file2.pdf --frame true --nup 2x2
    +  pdfjam file1.pdf file2.pdf file3.pdf --no-landscape --frame true --nup 2x2 \
    +         --suffix 4up --outfile ~/Documents
     
    -makes new files file1-2x2.pdf and file2-2x2.pdf in the current directory, with -a border printed around the 4 input pages on each output page. -

    +

    Here a directory was specified at --outfile: the resultant file in this case will be ~/Documents/file3-4up.pdf. (Note that if there's a writeable file with that name already, it will be overwritten: no check is made, and no warning given.)

    -

    -Other options to pdfnup include --pages, --paper, --orient, ---trim, --delta, --offset, --scale and --openright. +

    Example 4

    + +

    Suppose we have a document made up of "US letter" size pages, and we want to convert it to A4:

    -

    -For pdfjoin,

    -  pdfjoin file1.pdf file2.pdf file3.pdf --fitpaper true
    +  pdfjam 'my US letter file.pdf' --a4paper --outfile 'my A4 file.pdf'
     
    -produces a new file file3-joined.pdf in the current directory, with all -pages included at their original sizes. +

    Example 5

    + +

    A useful application of pdfjam is for producing a handout from a file of presentation slides. For slides made with the standard 4:3 aspect ratio a nice 6-up handout on A4 paper can be made by

    +
    -  pdfjoin file1.pdf file2.pdf file3.pdf --fitpaper false --paper a4paper --outfile ~/docs/mybigfile.pdf
    +  pdfjam --nup 2x3 --frame true --noautoscale false --delta "0.2cm 0.3cm" \
    +         --scale 0.95 myslides.pdf --outfile myhandout.pdf
     
    -scales all of the pages to fit on A4-size paper, and makes the resultant file as ~/docs/mybigfile.pdf . +

    The --delta option here comes from the pdfpages package; the --scale option is passed to LaTeX's \includegraphics command.

    + +

    The two wrapper scripts pdfjam-slides6up and pdfjam-slides3up are provided in order to make this particular application of pdfjam easy: for example,

    -

    -One possible use for pdfjoin, then, is to change the paper size of a PDF file, for example

    -  pdfjoin USletterfile.pdf --paper a4paper --fitpaper false --outfile USletterfile-A4size.pdf
    +  pdfjam-slides3up --pagenumbering true --batch slides1.pdf slides2.pdf
     
    -

    +

    makes a pair of 3-up handouts slides1-3up.pdf and slides2-3up.pdf, with space for side-notes and with the handout pages numbered.

    -

    -Other options to pdfjoin include --trim and --offset. -The output -filename and location are determined by the last input file if ---outfile is not specified. -

    +

    (Slides made by LaTeX's beamer package, using the handout class option, work especially nicely with this!)

    + +

    Example 6

    + +

    Suppose we want to trim the pages of our input file prior to n-upping. This can be done by using a pipe:

    -

    -For pdf90,

    -  pdf90 file1.pdf --outfile stuff/myrotatedfile.pdf
    -
    -rotates all pages and puts the result in myrotatedfile.pdf in subdirectory stuff of the current directory, while + pdfjam myfile.pdf --trim '1cm 2cm 1cm 2cm' --clip true --outfile /dev/stdout | \ + pdfnup --frame true --outfile myoutput.pdf + +

    The --trim option specifies an amount to trim from the left, bottom, right and top sides respectively; to work as intended here it needs also --clip true. These (i.e., trim and clip) are in fact options to LaTeX's \includegraphics command (in the standard graphics package).

    + +

    (Thanks to Christophe Lange and Christian Lohmaier for suggesting an example on this.)

    + +

    Example 7

    + +

    To offset the content of double-sided printed pages so that they are suitable for binding with a Heftstreifen, use the --twoside option:

    +
    -  pdf90 file1.pdf file2.pdf
    +   pdfjam --twoside myfile.pdf --offset '1cm 0cm' --suffix 'offset'
     
    -makes new files file1-rotated.pdf and file2-rotated.pdf in the current directory. pdf90 retains original page sizes in the output file. -

    +

    Example 8

    +

    To use PDF input files whose names do not end in ".pdf", you will need to use the --checkfiles option. This depends on the availability of the file utility, with support for the options -Lb; this can be checked by trying

    - -

    Mac OS X only: drag-and-drop

    +
    +  file -Lb 'my PDF file'
    +
    +

    where 'my PDF file' is the name of a PDF file on your system. The result should be something like "PDF document, version 1.4" (possibly with a different version number).

    -Under Mac OS X, DropScript -can be used to make simple drag-and-drop applications from these scripts. -Some sample droplets are provided in -pdfdroplets_1.20.tgz: -these may be all you'll need! The sample droplets look like this: -
    - -
    -

    +

    With "file -Lb" available, we can use PDF files whose names lack the usual ".pdf" extension. For example,

    + +
    +  pdfnup --checkfiles 'my PDF file'
    +
    +

    should result in a file named "my PDF file-nup.pdf" in the current working directory.

    + +

    Example 9

    + +

    Please feel free to suggest other examples that might help people! (For the email address, see reporting bugs)

    + +

    Mac OS X only: drag-and-drop

    + +

    Under Mac OS X, DropScript has been used to make some simple drag-and-drop applications. Some sample droplets are provided in pdfdroplets_1.21.dmg: these may be all you'll need! The sample droplets look like this:

    + +
    +

    These droplets assume that your pdflatex is at /usr/texbin/pdflatex. If pdflatex lives somewhere else on your system, the droplets won't work until you include in your home directory a file named .pdfnup.conf (or there is a system-wide file pdfnup.conf at one of the four locations listed above), containing the line

    -

    -These droplets assume that your pdflatex is at -/usr/local/teTeX/bin/powerpc-apple-darwin-current/pdflatex. -If pdflatex lives somewhere else on your system, the droplets -won't work until you include in your home directory a file -named .pdfnup.conf (or there is a system-wide file pdfnup.conf -at one of the four locations listed above), -containing the line

     pdflatex=/path/to/pdflatex
     
    -where /path/to/pdflatex is the answer you get when you type - which pdflatex in the Terminal. -

    - - -

    FAQ

    - -

    -1. Why "PDFjam"?
    Because it's for PDF files, and jam is what I like best -on my toast (well, second best after marmalade, anyway). -

    -2. The thing runs but the output doesn't look the way it should. Why?
    - Most likely either your pdfTeX or your pdfpages installation is an old version. (Check also that pdftex.def, to be found in in .../texmf/tex/latex/graphics/, is up to date.) If the problem persists even with up-to-date versions of pdfTeX, pdftex.def and pdfpages, then please do let me know about it. -

    - - -

    Version history

    -

    -1.20: -added minimal man pages; added extra possible locations for the site-wide -configuration file [2005-01-25] -

    -1.11: -added the --scale option to pdfnup, which allows page margins either -to be enlarged (e.g,. --scale 0.9) or reduced (e.g,. --scale 1.1) -by scaling the page contents. By popular request! [2004-10-13] -

    -1.10: -output files now appear by default in same directory as input, rather than in the -current working directory; fixed a bug that caused the scripts not -to work on some versions of Solaris (thanks to Daniel Gebhart); -major improvements to the Mac OS X sample droplets. [2004-06-24] -

    -1.03: minor changes towards POSIX compliance. [2004-05-09] -

    -1.02: added a COPYING file to the package. [2004-05-08] -

    -1.01: fixed a bad (and accidental) feature in pdfjoin whereby it would leave a file -named "temp" in the user's home directory; some new options added to -pdfnup and pdfjoin. [2004-05-08] -

    -1.00: package re-named PDFjam. [2004-05-07] -

    -0.99a: a minor change to the output of pdfnup --help -and pdfjoin --help [2004-05-06] -

    -0.99: various improvements to pdfnup, including the handling of -multiple -PDF input files. Added pdfjoin and pdf90. [2004-05-05] -

    -0.97: corrections to the output of pdfnup --help [2004-04-23] -

    -0.96: minor changes to comments in the pdfnup script [2004-02-12] -

    -0.95: added the possibility of site-specific and user-specific -configuration files (thanks to Jason Lewis for suggesting this) [2004-01-28] -

    -0.9: added --openright (thanks to Jason Lewis for -suggesting this) [2004-01-28] -

    -0.8: added pdfnup --help facility (thanks to Wilfrid Kendall -for this suggestion) [2003-09-12] -

    -0.7: paths involving spaces now permitted; page trimming added (thanks -to Alex Montgomery for suggesting that); default output filename now has a -dash inserted before the "nup" label (as in wasteful-2x2.pdf ); -sample Mac OS X droplets provided -[2003-01-26] -

    -0.6: use of paths involving spaces now reports an error [2002-08-22] -

    -0.5: fixed a bug which caused incompatibility with some types of unix -[2002-06-24] -

    -0.4: better error trapping, improved portability [2002-04-30] -

    -0.3: first public release of pdfnup (2002-04-04) +

    where /path/to/pdflatex is the answer you get when you type which pdflatex in the Terminal. (If you get no answer, chances are that you do not have pdflatex installed on your Mac; if you need to install it, you could just download and install MacTeX or one of its slimmed-down variants.)

    + +

    FAQ

    + +

    1. Why "PDFjam"?
    + Because it's for PDF files, and jam is what I like best on my toast (well, second best after marmalade, anyway).

    + +

    2. The thing runs but the output doesn't look the way it should. Why?
    + Most likely either your pdfTeX or your pdfpages installation is an old version. (Check also that pdftex.def, to be found in in .../texmf/tex/latex/graphics/, is up to date.) If the problem persists even with up-to-date versions of pdfTeX, pdftex.def and pdfpages, then please do report it.

    + +

    Reporting bugs

    + +

    Please report any bugs found in these scripts, to d.firth (at warwick.ac.uk).

    + +

    Some known problems:

    + +
      +
    • Use of pdfjam in a pipeline does not seem to work in Cygwin. Scripts like pdfjam-pocketmod, which use pipelines, therefore do not work there. The problem seems to be with Cygwin's handling of file descriptors with pipelines.
    • +
    + +

    Solving these problems is on the to-do list: if you have solved one of them already please let me know!

    + +

    Version history

    + +

    2.05: changes to the pdfbook script — the --right-edge-binding option is now redundant, and there's a new --short-edge option for binding along the short edge of pages instead of the long edge (thanks to Marco Pessotto for this). The --preamble option to pdfjam is enhanced, to allow multiple instances which get concatenated. Also various minor corrections to man pages. [2010-04-25]

    + +

    2.04: various minor improvements suggested by Debian maintainers (thanks to Eduard Bloch for these). The main things are: addition of the --version option; liberalisation of pdfjam to allow files in JPEG format to be specified as input, as well as PDF (I don't know why or if this might work! but some people have said it does); tidying of the man files; and more use of exec, to avoid forking. [2010-04-22]

    + +

    2.03: fixed a bug which caused problems when your /bin/sh is the zsh shell; fixed a bug which prevented the correct representation of many UTF-8 characters in pdfinfo data. [2010-04-20]

    + +

    2.02: more progress on portability; introduced the beginnings of a suite of tests; improvements in the --keepinfo functionality, and in the treatment of file permissions (thanks to Marco Pessotto for these). [2010-04-14]

    + +

    2.01: fixed a silly bug (thoughtless use of "test -a" in a couple of places) which seriously affected portability. [2010-04-13]

    + +
    +

    2.00: a major re-design. This is not completely backward-compatible with previous versions of the pdfnup, pdfjoin and pdf90 scripts. The differences in interface are few, though, and the main ones are listed below.

    + +

    The main changes are:

    + +
      +
    • The new script pdfjam now does all the work; all the other scripts included with the package are just simple wrappers for pdfjam.
    • +
    • pdfjam makes available essentially all of the facilities of the pdfpages package (without having to know what they are).
    • +
    • Various security and portability issues have been resolved. (None of the scripts now calls for /bin/bash; and the handling of temporary files is now much safer.)
    • +
    • pdfjam can take PDF input from /dev/stdin, and send output to /dev/stdout. (This allows pdfjam to be used in a pipeline.)
    • +
    • If the --outfile option specifies a relative path, that path is now relative to the current working directory (as is normally expected of unix utilities). This is different behaviour from previous versions.
    • +
    • With multiple input files, pdfjam offers two distinct methods of processing. The default is to take pages as specified from the input files, and combine them into a single document. If the --batch option is used, pdfjam operates separately on the input files, producing one output file per input file. This is different behaviour from previous versions.
    • +
    • Page selection is available separately for each input file. A difference from previous versions is that the --pages keyword is no longer used.
    • +
    • pdfjam uses the \includepdfmerge command from pdfpages, as a result of which all pages in an output file have the same size and orientation. This is different behaviour from previous versions.
    • +
    • Output page orientation is now controlled by using --landscape (negated, if necessary, by --no-landscape). The previous --orient option is no longer used, and in particular "--orient auto" is no longer available. This is different behaviour from previous versions.
    • +
    • Other new features include: +
        +
      • --keepinfo option, to allow preservation of PDF document information, if the pdfinfo utility and the LaTeX hyperref package are available (thanks to Robert Wenner for suggesting this);
      • +
      • --pdftitle, --pdfauthor, --pdfsubject and --pdfkeywords options, to specify new PDF document information (these require the LaTeX hyperref package);
      • +
      • many more "named" output page sizes are available if the LaTeX geometry package is installed (the full list of allowed paper specifications is: a0paper, a1paper, a2paper, a3paper, a4paper, a5paper, a6paper b0paper, b1paper, b2paper, b3paper, b4paper, b5paper, b6paper letterpaper, executivepaper, legalpaper;  thanks to Corné Verbruggen and Mel Irizarry for suggesting this) and non-standard page sizes can also be defined;
      • +
      • --checkfiles option to request that input files be checked using the file utility, rather than requiring the file name to end in ".pdf" or ".PDF";
      • +
      • --twoside option, to allow the LaTeX twoside class option to be specified (thanks to Johannes Reinhard for suggesting this);
      • +
      • --pagecolor option, to allow the background colour of output pages to be changed (thanks to James Fisher for suggesting this);
      • +
      • --vanilla option to run pdfjam without reading site-wide or user configuration files.
      • +
      + +
    • +
    + +

    In addition, various reported bugs have been fixed — many thanks to all those kind people who reported them (too numerous to list here!) [2010-03-14]

    + +
    +

    1.21: bug fixes, including security issues (many thanks to Eduard Bloch, Robert Buchholz and Martin Vaeth for helpful reports on vulnerabilities and for kindly contributing patches); the scripts now call for /bin/bash as interpreter; availability of mktemp is now also assumed; the Mac OS X droplets now look for pdflatex at (by default) /usr/texbin/pdflatex [2009-01-19]

    + +

    1.20: added minimal man pages; added extra possible locations for the site-wide configuration file [2005-01-25]

    + +

    1.11: added the --scale option to pdfnup, which allows page margins either to be enlarged (e.g,. --scale 0.9) or reduced (e.g,. --scale 1.1) by scaling the page contents. By popular request! [2004-10-13]

    + +

    1.10: output files now appear by default in same directory as input, rather than in the current working directory; fixed a bug that caused the scripts not to work on some versions of Solaris (thanks to Daniel Gebhart); major improvements to the Mac OS X sample droplets. [2004-06-24]

    + +

    1.03: minor changes towards POSIX compliance. [2004-05-09]

    + +

    1.02: added a COPYING file to the package. [2004-05-08]

    + +

    1.00: package re-named PDFjam. [2004-05-07]

    + +

    0.99a: a minor change to the output of pdfnup --help and pdfjoin --help [2004-05-06]

    + +

    0.99: various improvements to pdfnup, including the handling of multiple PDF input files. Added pdfjoin and pdf90. [2004-05-05]

    + +

    0.97: corrections to the output of pdfnup --help [2004-04-23]

    + +

    0.96: minor changes to comments in the pdfnup script [2004-02-12]

    + +

    0.95: added the possibility of site-specific and user-specific configuration files (thanks to Jason Lewis for suggesting this) [2004-01-28]

    + +

    0.9: added --openright (thanks to Jason Lewis for suggesting this) [2004-01-28]

    + +

    0.8: added pdfnup --help facility (thanks to Wilfrid Kendall for this suggestion) [2003-09-12]

    + +

    0.7: paths involving spaces now permitted; page trimming added (thanks to Alex Montgomery for suggesting that); default output filename now has a dash inserted before the "nup" label (as in wasteful-2x2.pdf ); sample Mac OS X droplets provided [2003-01-26]

    + +

    0.6: use of paths involving spaces now reports an error [2002-08-22]

    + +

    0.5: fixed a bug which caused incompatibility with some types of unix [2002-06-24]

    + +

    0.4: better error trapping, improved portability [2002-04-30]

    + +

    0.3: first public release of pdfnup [2002-04-04]

    + - + \ No newline at end of file diff -Nru pdfjam-1.20/scripts/pdf90 pdfjam-2.05/scripts/pdf90 --- pdfjam-1.20/scripts/pdf90 2010-05-28 14:36:17.000000000 +0100 +++ pdfjam-2.05/scripts/pdf90 1970-01-01 01:00:00.000000000 +0100 @@ -1,208 +0,0 @@ -#! /bin/bash -## -## pdf90: A shell program to rotate all pages of PDF files -## -## Author David Firth (http://www.warwick.ac.uk/go/dfirth) -## -version=1.20 -echo "This is pdf90 version ""$version" -## -## Relies on pdflatex and the 'pdfpages' package (version 0.2e -## or later). -## -####################################################################### -## CONFIGURATION: change this block as necessary -## -## THESE SETTINGS WILL BE OVER-RIDDEN by any found at -## /etc/pdfnup.conf -## /usr/share/etc/pdfnup.conf -## /usr/local/share/pdfnup.conf -## /usr/local/etc/pdfnup.conf -## ~/.pdfnup.conf -## (which are read in that order) -## -## First say where your "pdflatex" program lives: -## -pdflatex="/usr/bin/pdflatex" -#pdflatex="pdflatex.exe" ## this for Windows computers -## -## Next a permitted location for temporary files on your system: -## -tempfileDir="/var/tmp" ## /var/tmp is standard on most unix systems -#tempfileDir="C:/tmp" ## use something like this under Windows -## -## Now specify the default settings for pdf90: -## -tidy=true ## delete all temporary files immediately -## -## END OF CONFIGURATION -####################################################################### -## -## Read the configuration file(s) if such exist: -## -for d in /etc /usr/share/etc /usr/local/share /usr/local/etc -do if test -f $d/pdfnup.conf; then - echo "Reading site configuration from $d/pdfnup.conf" - source $d/pdfnup.conf - fi -done -if test -f ~/.pdfnup.conf; then - echo "Reading user defaults from ~/.pdfnup.conf"; - source ~/.pdfnup.conf; -fi -####################################################################### -## -## Define the output of "pdf90 --help" -## -helptext=" -Usage: pdf90 args -where args must include source pdf filename(s) and optionally also -* a specific name for the output file, e.g. --outfile myrotatedfile.pdf -* one of --tidy true - --tidy false - according to whether or not temporary files should be deleted immediately. - If --tidy false is used, such files are left in $tempfileDir. - -Default arguments for you at this site are - --tidy $tidy - -For information and version history see http://www.warwick.ac.uk/go/pdfjam -" -## -## Check that necessary LaTeX packages are installed -## -PATH=`dirname "$pdflatex"`:$PATH -export PATH -case `kpsewhich pdfpages.sty` in - "") echo "pdf90: pdfpages.sty not installed"; exit 1;; -esac -case `kpsewhich eso-pic.sty` in - "") echo \ - "pdf90: eso-pic.sty not installed (see the pdfpages manual)" - exit 1;; -esac -case `kpsewhich everyshi.sty` in - "") echo \ - "pdf90: everyshi.sty not installed (see the pdfpages manual)" - exit 1;; -esac -## -## Now do the argument loop... -## -sourcePath= -outFile= -inFiles=0 -newline=' -' -while test -n "${1}"; do - case "${1}" in - *.pdf|*.PDF) inFiles=`expr $inFiles + 1`; - sourcePath="$sourcePath$newline${1}";; - --help) echo "$helptext"; - exit 0;; - --outfile) outFile="${2}" - case "$outFile" in - *".pdf");; - *) echo "pdf90: outfile name must end in .pdf"; - exit 1;; - esac - shift;; - --tidy) tidy="${2}" - shift;; - *) echo "pdf90: unrecognised argument ${1}"; exit 1;; - esac - shift -done -if test $inFiles -gt 1 ; then - if test "$outFile" != "" ; then - echo "pdf90: --outfile cannot be used with multiple input files"; - echo "pdf90: no files processed" - exit 1; - fi -fi -case "$sourcePath" in - "") echo "pdf90: no pdf source file specified -For information on usage try \"pdf90 --help\""; exit 1;; -esac -OIFS=IFS -IFS="$newline" -for k in $sourcePath -do - if test -f "$k"; then :; - else echo "pdf90: ""$k"" does not exist, no files were processed"; - exit 1; - fi -done -## -## That's the arguments done. -## -## -## Now work on the input file (or files in turn) -## -pwd=`pwd | sed 's/ /\\ /'` -counter=0 -for inFile in $sourcePath -do - counter=`expr $counter + 1` - echo "Processing $inFile..." - cd "$pwd" - pdfName=`basename "$inFile"` - sourceDir=`dirname "$inFile"` ; cd "$sourceDir" ; sourceDir=`pwd` - sourceFullPath="$sourceDir"/"$pdfName" - cd "$pwd" - case "$outFile" in - "") ## no --outfile argument supplied - outfileNameRoot=`echo "$pdfName" | sed 's/\.pdf$//i'`-rotated; - outfileDir="$sourceDir"; - outFile="$outfileNameRoot"".pdf";; - *) ## --outfile argument was supplied - outfileNameRoot=`basename "$outFile" | sed 's/\.pdf$//i';` - outfileDir=`dirname "$outFile"` ; - cd "$outfileDir" ; - outfileDir=`pwd` ;; - esac - case "$outfileDir"/"$outfileNameRoot"".pdf" in - $sourceFullPath) echo "pdf90: outfile and source cannot be the same"; - exit 1;; - //"$outfileNameRoot"".pdf") outfileDir="";; ## in case of output - esac ## to the root directory! - ## - ## Now edit the temporary LaTeX input file - ## - uniqueName="$RANDOM$RANDOM$RANDOM"-"$counter" - ln -s "$sourceFullPath" "$tempfileDir"/"$uniqueName"source.pdf - texFile="$tempfileDir"/"$uniqueName".tex - msgFile="$tempfileDir"/"$uniqueName".msgs - (sed s*pdfname*"$tempfileDir"/"$uniqueName"source.pdf* < $texFile - echo " Temporary LaTeX file for this job is ""$texFile" - ## - ## Now run pdflatex and tidy up - ## - echo " Calling pdflatex..." - cd "$tempfileDir" - "$pdflatex" --interaction batchmode "$texFile" > "$msgFile" - if test -f "$tempfileDir"/"$uniqueName"".aux"; - ## ie if LaTeX didn't choke - then if cp "$tempfileDir"/"$uniqueName".pdf \ - "$outfileDir"/"$outfileNameRoot"".pdf" - then echo " Finished: output is"\ - "$outfileDir"/"$outfileNameRoot"".pdf" - fi - case "$tidy" in - true) rm "$tempfileDir"/"$uniqueName"* ;; - esac - outFile="" - else echo " Failed: output file not written" - fi -done -IFS=OIFS - - - diff -Nru pdfjam-1.20/scripts/pdfjoin pdfjam-2.05/scripts/pdfjoin --- pdfjam-1.20/scripts/pdfjoin 2010-05-28 14:36:17.000000000 +0100 +++ pdfjam-2.05/scripts/pdfjoin 1970-01-01 01:00:00.000000000 +0100 @@ -1,247 +0,0 @@ -#! /bin/bash -## -## pdfjoin: A shell program to concatenate PDF pages into one file -## -## Author David Firth (http://www.warwick.ac.uk/go/dfirth) -## -version=1.20 -echo "This is pdfjoin version ""$version" -## -## Relies on pdflatex and the 'pdfpages' package (version 0.2e -## or later). -## -####################################################################### -## CONFIGURATION: change this block as necessary -## -## THESE SETTINGS WILL BE OVER-RIDDEN by any found at -## /etc/pdfnup.conf -## /usr/share/etc/pdfnup.conf -## /usr/local/share/pdfnup.conf -## /usr/local/etc/pdfnup.conf -## ~/.pdfnup.conf -## (which are read in that order) -## -## First say where your "pdflatex" program lives: -## -pdflatex="/usr/bin/pdflatex" -#pdflatex="pdflatex.exe" ## this for Windows computers -## -## Next a permitted location for temporary files on your system: -## -tempfileDir="/var/tmp" ## /var/tmp is standard on most unix systems -#tempfileDir="C:/tmp" ## use something like this under Windows -## -## Now specify the default settings for pdfjoin: -## -paper=a4paper ## alternatives are other LaTeX paper sizes -orient=portrait -fitpaper=true ## output page size matches input -turn=true ## landscape pages are landscape-oriented -noautoscale=false ## scale logical pages to fit -offset="0 0" ## output centred on physical page -trim="0 0 0 0" ## don't trim the logical pages -tidy=true ## delete all temporary files immediately -## -## END OF CONFIGURATION -####################################################################### -## -## Read the configuration file(s) if such exist: -## -for d in /etc /usr/share/etc /usr/local/share /usr/local/etc -do if test -f $d/pdfnup.conf; then - echo "Reading site configuration from $d/pdfnup.conf" - source $d/pdfnup.conf - fi -done -if test -f ~/.pdfnup.conf; then - echo "Reading user defaults from ~/.pdfnup.conf"; - source ~/.pdfnup.conf; -fi -####################################################################### -## -## Define the output of "pdfjoin --help" -## -helptext=" -Usage: pdfjoin args -where args must include source pdf filenames and optionally also -* a LaTeX papersize, for example --paper a4paper - --paper letterpaper -* the output page orientation, one of --orient landscape - --orient portrait -* one of --fitpaper true - --fitpaper false - to specify whether output page sizes and orientations should match - those of the input pages. Use of --fitpaper true overrides --orient. -* a page-trimming specification such as - --trim \"1cm 1cm 1cm 1cm\" - (Note that trimming does not mix well with --frame true.) -* an \"offset\" specification such as - --offset \"1cm 0.5cm\" - to offset the position of output pages (see the pdfpages manual) -* one of --turn true - --turn false - according to whether or not landscape pages should be displayed in - landscape orientation -* one of --noautoscale true - --noautoscale false - for scaling of logical pages to fit (or not) -* a specific name for the output file, e.g. --outfile mybigfile.pdf -* one of --tidy true - --tidy false - according to whether or not temporary files should be deleted immediately. - If --tidy false is used, such files are left in $tempfileDir. - -Default arguments for you at this site are - --paper $paper --trim \"$trim\" --offset \"$offset\" --turn $turn --noautoscale $noautoscale --tidy $tidy - -For information and version history see http://www.warwick.ac.uk/go/pdfjam -" -## -## Check that necessary LaTeX packages are installed -## -PATH=`dirname "$pdflatex"`:$PATH -export PATH -case `kpsewhich pdfpages.sty` in - "") echo "pdfjoin: pdfpages.sty not installed"; exit 1;; -esac -case `kpsewhich eso-pic.sty` in - "") echo \ - "pdfjoin: eso-pic.sty not installed (see the pdfpages manual)" - exit 1;; -esac -case `kpsewhich everyshi.sty` in - "") echo \ - "pdfjoin: everyshi.sty not installed (see the pdfpages manual)" - exit 1;; -esac -## -## Now do the argument loop... -## -sourcePath= -outFile= -inFiles=0 -newline=' -' -while test -n "${1}"; do - case "${1}" in - *.pdf|*.PDF) inFiles=`expr $inFiles + 1`; - sourcePath="$sourcePath$newline${1}";; - --help) echo "$helptext"; - exit 0;; - --outfile) outFile="${2}" - case "$outFile" in - *".pdf");; - *) echo "pdfjoin: outfile name must end in .pdf"; - exit 1;; - esac - shift;; - --paper) paper="${2}" - shift;; - --orient) orient="${2}" - shift;; - --fitpaper) fitpaper="${2}" - shift;; - --trim) trim="${2}" - shift;; - --offset) offset="${2}" - shift;; - --turn) turn="${2}" - shift;; - --noautoscale) noautoscale="${2}" - shift;; - --tidy) tidy="${2}" - shift;; - *) echo "pdfjoin: unrecognised argument ${1}"; exit 1;; - esac - shift -done -case "$sourcePath" in - "") echo "pdfjoin: no pdf source file specified -For information on usage try \"pdfjoin --help\""; exit 1;; -esac -OIFS=IFS -IFS="$newline" -for k in $sourcePath -do - if test -f "$k"; then :; - else echo "pdfjoin: ""$k"" does not exist, no files were processed"; - exit 1; - fi -done -## -## That's the arguments done. -## -## -## Now work on the input files -## -pwd=`pwd | sed 's/ /\\ /'` -sourceFullPath="" -for inFile in $sourcePath -do - pdfName=`basename "$inFile"` - sourceDir=`dirname "$inFile"` ; cd "$sourceDir" ; sourceDir=`pwd` - sourceFullPath=$sourceFullPath$newline"$sourceDir"/"$pdfName" - cd "$pwd" -done -case "$outFile" in - "") ## no --outfile argument supplied - outfileNameRoot=`echo "$pdfName" | sed 's/\.pdf$//i'`-joined; - outfileDir="$sourceDir"; - outFile="$outfileNameRoot"".pdf";; - *) ## --outfile argument was supplied - outfileNameRoot=`basename "$outFile" | sed 's/\.pdf$//i';` - outfileDir=`dirname "$outFile"` ; - cd "$outfileDir" ; - outfileDir=`pwd` ;; -esac -## -## Now set up the temporary LaTeX input file -## -uniqueName="$RANDOM$RANDOM$RANDOM" -i=0 -linkedSources="" -for k in $sourceFullPath -do - i=`expr $i + 1` - ln -s "$k" "$tempfileDir"/"$uniqueName"source$i.pdf - linkedSources=$linkedSources$newline"$tempfileDir"/"$uniqueName"source$i.pdf -done -texFile="$tempfileDir"/"$uniqueName".tex -msgFile="$tempfileDir"/"$uniqueName".msgs -mytemp=`cat < $texFile -echo " Temporary LaTeX file for this job is ""$texFile" -## -## Now run pdflatex and tidy up -## -echo " Calling pdflatex..." -cd "$tempfileDir" -"$pdflatex" --interaction batchmode "$texFile" > "$msgFile" -if test -f "$tempfileDir"/"$uniqueName"".aux"; - ## ie if LaTeX didn't choke - then if cp "$tempfileDir"/"$uniqueName".pdf \ - "$outfileDir"/"$outfileNameRoot"".pdf" - then echo " Finished: output is"\ - "$outfileDir"/"$outfileNameRoot"".pdf" - fi - case "$tidy" in - true) rm "$tempfileDir"/"$uniqueName"* ;; - esac - else echo " Failed: output file not written" -fi diff -Nru pdfjam-1.20/scripts/pdfnup pdfjam-2.05/scripts/pdfnup --- pdfjam-1.20/scripts/pdfnup 2010-05-28 14:36:17.000000000 +0100 +++ pdfjam-2.05/scripts/pdfnup 1970-01-01 01:00:00.000000000 +0100 @@ -1,335 +0,0 @@ -#! /bin/bash -## -## pdfnup: A shell program to generate a "n-up" version of a PDF file -## -## Author David Firth (http://www.warwick.ac.uk/go/dfirth) -## -version=1.20 -echo "This is pdfnup version ""$version" -## -## Relies on pdflatex and the 'pdfpages' package (version 0.2e -## or later). -## -####################################################################### -## CONFIGURATION: change this block as necessary -## -## THESE SETTINGS WILL BE OVER-RIDDEN by any found at -## /etc/pdfnup.conf -## /usr/share/etc/pdfnup.conf -## /usr/local/share/pdfnup.conf -## /usr/local/etc/pdfnup.conf -## ~/.pdfnup.conf -## (which are read in that order) -## -## First say where your "pdflatex" program lives: -## -pdflatex="/usr/bin/pdflatex" -#pdflatex="pdflatex.exe" ## this for Windows computers -## -## Next a permitted location for temporary files on your system: -## -tempfileDir="/var/tmp" ## /var/tmp is standard on many unix systems -#tempfileDir="C:/tmp" ## use something like this under Windows -## -## Now specify the default settings for pdfnup: -## -frame=false ## do not print a thin border around pages -nup=2x1 ## two logical pages side by side -paper=a4paper ## alternatives are other LaTeX paper sizes -orient=auto ## alternatives are landscape and portrait -pages=all -turn=true ## landscape pages are landscape-oriented -noautoscale=false ## scale logical pages to fit -column=false ## don't use column-major ordering -columnstrict=false ## (see the pdfpages manual) -delta="0 0" ## no space between logical pages -offset="0 0" ## output centred on physical page -trim="0 0 0 0" ## don't trim the logical pages -scale=1.0 ## don't scale the resultant pages -openright=false ## don't insert blank page at front of document -tidy=true ## delete all temporary files immediately -## -## END OF CONFIGURATION -####################################################################### -## -## Read the configuration file(s) if such exist: -## -for d in /etc /usr/share/etc /usr/local/share /usr/local/etc -do if test -f $d/pdfnup.conf; then - echo "Reading site configuration from $d/pdfnup.conf" - source $d/pdfnup.conf - fi -done -if test -f ~/.pdfnup.conf; then - echo "Reading user defaults from ~/.pdfnup.conf"; - source ~/.pdfnup.conf; -fi -####################################################################### -## -## Define the output of "pdfnup --help" -## -helptext=" -Usage: pdfnup args -where args must include source pdf filename(s) and optionally also -* a specification, such as --nup 2x1 (two pages side by side) - --nup 1x2 (two pages stacked vertically) - --nup 2x2 etc - (in general mxn, where m and n are single-digit integers) -* a list or range of pages to be included, for example - --pages 3-6 - --pages 2,8,4,5 - --pages all -* a LaTeX papersize, for example --paper a4paper - --paper letterpaper -* the output page orientation, one of --orient landscape - --orient portrait - --orient auto - (""auto"" guesses orientation; in the case of --nup 2x2, - --nup 3x3, etc., ""auto"" produces output pages the same size - as the logical pages being n-upped.) -* one of --frame true - --frame false - according to whether or not a thin line is required around pages -* a page-trimming specification such as - --trim \"1cm 1cm 1cm 1cm\" - (Note that trimming does not mix well with --frame true.) -* an \"offset\" specification such as - --offset \"1cm 0.5cm\" - to offset the position of output pages (see the pdfpages manual) -* a \"delta\" specification such as - --delta \"1cm 1cm\" - to put space between logical pages (see the pdfpages manual) -* a \"scale\" specification such as - --scale 0.91 - to scale the output up or down in size (decrease or increase margins) -* one of --openright true - --openright false - according to whether or not a blank page should be inserted before - the first logical page -* one of --turn true - --turn false - according to whether or not landscape pages should be displayed in - landscape orientation -* one of --noautoscale true - --noautoscale false - for scaling of logical pages to fit (or not) -* one of --column true - --column false - according to whether or not column-major order should be used -* one of --columnstrict true - --columnstrict false - for whether or not the *last* page should be column-major ordered - regardless of how full it is -* a specific name for the output file, e.g. --outfile my2up.pdf -* one of --tidy true - --tidy false - according to whether or not temporary files should be deleted immediately. - If --tidy false is used, such files are left in $tempfileDir. - -Default arguments for you at this site are - --frame $frame --nup $nup --paper $paper --orient $orient --pages $pages --trim \"$trim\" --delta \"$delta\" --offset \"$offset\" --scale $scale --turn $turn --noautoscale $noautoscale --openright $openright --column $column --columnstrict $columnstrict --tidy $tidy - -For information and version history see http://www.warwick.ac.uk/go/pdfjam -" -## -## Check that necessary LaTeX packages are installed -## -PATH=`dirname "$pdflatex"`:$PATH -export PATH -case `kpsewhich pdfpages.sty` in - "") echo "pdfnup: pdfpages.sty not installed"; exit 1;; -esac -case `kpsewhich eso-pic.sty` in - "") echo \ - "pdfnup: eso-pic.sty not installed (see the pdfpages manual)" - exit 1;; -esac -case `kpsewhich everyshi.sty` in - "") echo \ - "pdfnup: everyshi.sty not installed (see the pdfpages manual)" - exit 1;; -esac -## -## Now do the argument loop... -## -sourcePath= -outFile= -inFiles=0 -newline=' -' -while test -n "${1}"; do - case "${1}" in - *.pdf|*.PDF) inFiles=`expr $inFiles + 1`; - sourcePath="$sourcePath$newline${1}";; - --help) echo "$helptext"; - exit 0;; - --pages) pages="${2}" - shift;; - --outfile) outFile="${2}" - case "$outFile" in - *".pdf");; - *) echo "pdfnup: outfile name must end in .pdf"; - exit 1;; - esac - shift;; - --nup) nup="${2}" - shift;; - --frame) frame="${2}" - shift;; - --paper) paper="${2}" - shift;; - --orient) orient="${2}" - shift;; - --trim) trim="${2}" - shift;; - --delta) delta="${2}" - shift;; - --offset) offset="${2}" - shift;; - --scale) scale="${2}" - shift;; - --turn) turn="${2}" - shift;; - --noautoscale) noautoscale="${2}" - shift;; - --openright) openright="${2}" - shift;; - --column) column="${2}" - shift;; - --columnstrict) column="${2}" - shift;; - --tidy) tidy="${2}" - shift;; - *) echo "pdfnup: unrecognised argument ${1}"; exit 1;; - esac - shift -done -if test $inFiles -gt 1 ; then - if test "$outFile" != "" ; then - echo "pdfnup: --outfile cannot be used with multiple input files"; - echo "pdfnup: no files processed" - exit 1; - fi -fi -case "$sourcePath" in - "") echo "pdfnup: no pdf source file specified -For information on usage try \"pdfnup --help\""; exit 1;; -esac -OIFS=IFS -IFS="$newline" -for k in $sourcePath -do - if test -f "$k"; then :; - else echo "pdfnup: ""$k"" does not exist, no files were processed"; - exit 1; - fi -done -IFS=OIFS -case $pages in - all) pages=-;; - *) pages={$pages};; -esac -## -## That's the arguments done. -## -## Next sort out paper orientation, if not specified -## -x=`echo $nup | sed 's/..$//'` -y=`echo $nup | sed 's/^..//'` -fitpaper=false ## the normal setting -case $orient in - auto) fitpaper=true ## used only for 2x2, 3x3 etc. - if test "$x" -gt "$y" - then orient=landscape ; fitpaper=false - fi - if test "$y" -gt "$x" - then orient=portrait ; fitpaper=false - fi;; -esac -pwd=`pwd | sed 's/ /\\ /'` -IFS="$newline" -## -## Now work on the input file (or files in turn) -## -counter=0 -for inFile in $sourcePath -do - echo "Processing $inFile..." - counter=`expr $counter + 1` - cd "$pwd" - pdfName=`basename "$inFile"` - sourceDir=`dirname "$inFile"` ; cd "$sourceDir" ; sourceDir=`pwd` - sourceFullPath="$sourceDir"/"$pdfName" - cd "$pwd" - case "$outFile" in - "") ## no --outfile argument supplied - outfileNameRoot=`echo "$pdfName" | sed 's/\.pdf$//i'`-$nup; - outfileDir="$sourceDir"; - outFile="$outfileNameRoot"".pdf";; - *) ## --outfile argument was supplied - outfileNameRoot=`basename "$outFile" | sed 's/\.pdf$//i';` - outfileDir=`dirname "$outFile"` ; - cd "$outfileDir" ; - outfileDir=`pwd` ;; - esac - case "$outfileDir"/"$outfileNameRoot"".pdf" in - $sourceFullPath) echo "pdfnup: outfile and source cannot be the same"; - exit 1;; - //"$outfileNameRoot"".pdf") outfileDir="";; ## in case of output - esac ## to the root directory! - ## - ## Now edit the temporary LaTeX input file - ## - uniqueName="$RANDOM$RANDOM$RANDOM"-"$counter" - ln -s "$sourceFullPath" "$tempfileDir"/"$uniqueName"source.pdf - texFile="$tempfileDir"/"$uniqueName".tex - msgFile="$tempfileDir"/"$uniqueName".msgs - (sed s*pdfname*"$tempfileDir"/"$uniqueName"source.pdf* < $texFile - echo " Temporary LaTeX file for this job is ""$texFile" - ## - ## Now run pdflatex and tidy up - ## - echo " Calling pdflatex..." - cd "$tempfileDir" - "$pdflatex" --interaction batchmode "$texFile" > "$msgFile" - if test -f "$tempfileDir"/"$uniqueName"".aux"; - ## ie if LaTeX didn't choke - then if cp "$tempfileDir"/"$uniqueName".pdf \ - "$outfileDir"/"$outfileNameRoot"".pdf" - then echo " Finished: output is"\ - "$outfileDir"/"$outfileNameRoot"".pdf" - fi - case "$tidy" in - true) rm "$tempfileDir"/"$uniqueName"* ;; - esac - outFile="" - else echo " Failed: output file not written" - fi -done -IFS=OIFS - - - Binary files /tmp/sY9d0ulZxa/pdfjam-1.20/tests.zip and /tmp/GSeWTN9efT/pdfjam-2.05/tests.zip differ diff -Nru pdfjam-1.20/VERSION pdfjam-2.05/VERSION --- pdfjam-1.20/VERSION 2005-01-20 18:54:03.000000000 +0000 +++ pdfjam-2.05/VERSION 2010-04-22 15:46:18.000000000 +0100 @@ -1 +1 @@ -This is PDFjam 1.20 \ No newline at end of file +This is PDFjam 2.05 \ No newline at end of file