Saturday, 25 February 2006

Postscript Layout

Normally I pipe my postscript printouts through xpp. Sadly xpp’s multiple copies doesn’t seem to work for my printouts, and it also lacks the ability to scale and rotate the image to get multiple smaller copies per page.

I wrote a quick bash script I put together so I can scale A4 postscript printouts to fit multiple images per page, so to print 4 per page, with 2 pages I now pipe through:

| psmul 4 2 | xpp

Here it is:

#! /bin/sh
MUL=${1:-8}
PAGES=${2:-1}
SPEC="0"
C=1

while test "$C" -lt "$MUL"
do
  SPEC="$SPEC,0"
  C=$(($C+1))
done

NUP="$SPEC"
C=1

while test "$C" -lt "$PAGES"
do
  SPEC="$SPEC,$NUP"
  C=$((C+1))
done

pstops $SPEC | psnup -$MUL

No comments:

Post a comment