Shuffle pages

Taco Hoekwater taco.hoekwater at wkap.nl
Tue Dec 1 16:18:44 CET 1998


 >> I'm running a small newsletter in Telecommunications & Electronics
 >> at my University, and I want to know if there is something like
 >> the "dvitodvi", "ps2ps" or "psbook" utilities to shuffle pages and
 >> rearrange them in such a way that they are ready to print in a
 >> booklet format directly in PDF instead of PS. Actually I

Sebastian's solution sounds reasonable to me, but here are some other
approaches: you could find a binary safe text editor, open the PDF
document, find the lines that say:

/Type /Pages
/Kids [1 0 R 14 0 R 17 0 R 21 0 R 25 0 R 28 0 R]

and rearrange the numbers yourself. the logic is "<<x1> <y1> R> <<x2>
<y2> R> <<xn> <yn> R>". Make sure you always move <x,y,R> triples, and
they appear in print in the order that they are mentioned in the /Kids
list. In this case, for instance, <25 0 R> is becoming page 5.

This may not work for all documents (since the /Pages things can be
nested) but generally this simple scheme will work just fine. Make
sure you/your editor don't insert or delete any bytes though. 

[Or get a better printer driver...]
[Or use ConTeXt, which has macro-based collationing up to blocks of 32
pages..]
[Or wait until someone writes a perl script to do this]
[Or buy Adobe Exchange]

Greetings, Taco





More information about the pdftex mailing list