PDF Half page splitting

2009-02-26 12:15:18 (ID: 222, Parent: 0, Type: post)

I’ve found this interresting script digging around.  As I’ve a lot of old book got scanned 2 / 1 pages and I don’t found then easy to read on my portable device I think this could be useful.

#script:    unpnup
#        This script reformats pdf files where two portait pages
#        are joined on one landscape page (like pnup does). After
#        completion each page is on one single fullframe page
#         Copyright (c) 2007 F5 GmbH
# Author: Harald Hackenberg <>
#programs required:
#           pdftk, pdftops, poster, epstopdf
# 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.  See for
# the full text of the license.
if [ “$1″ == “” ] || [ “$1″ == “–help” ]; then
echo “Usage: `basename $0` filename”

mkdir tmp
cd tmp
pdftk “$1″ burst
for file in pg*.pdf;
pdftops -eps $file
poster -v -pA4 -mA5 -c0% `basename $file .pdf`.eps > `basename $file .pdf`.tps
epstopdf `basename $file .pdf`.tps
pdftk pg*.pdf cat output ../`basename $1 .pdf`_unpnuped.pdf
rm *
cd ..
rmdir tmp