Scripts & Programs

duplex2up.py --- Transform ps documents into duplex 2up form (on A4 paper).

When printing long documents, it's nice to use duplex and 2up to save trees and reduce the weight and volume of the document. Often this results in tiny font size, so this script enlarges the document as much as possible, stripping the margins to the bare minimum.

Usage: duplex2up.py <filename> <x0> <y0> <x1> <y1> [<x0> <y0> <x1> <y1>]

where the (x,y) are the coordinates of the lower left & upper right corners of the bounding box. If two bounding box coordinate sets are specified, they correspond to the odd and even numbered pages, respectively.

Tip: ghostscript can compute the bounding box for you: gs -sDEVICE=bbox -dNOPAUSE -dBATCH filename.ps