Arranging pages for chapbook printing

I once had a project to print out a 120-page booklet. Since it was a limited run, the cheapest way to do it was to print it on letter-size paper, back-to-back, with two pages per side. Then, staple them down the middle. Now, the question is: how do you print the document so that when you staple them right down the middle, the pages come out in proper order?

For the simplest case, a 4-page document, the pages should print in the following order: 4, 1, 2, 3. Printed two pages to a sheet face, back-to-back on a single sheet, when you fold them down the middle, you get the pages in correct order.

For the more complicated case, an 8-page document, you need to print the pages in the following order: 8, 1, 2, 7, 6, 3, 4, 5.

But what about for 120 pages?

For that, I wrote a simple Python program.


import sys

def arrangeForBookPrinting(pages):
if pages % 4 != 0:
pages=(pages / 4 + 1) * 4
for p2 in range(pages,pages/2,-1):
if p1 % 2 == 1:
s = s + str(p2) + "," +str(p1) + ","
s = s + str(p1) + "," +str(p2) + ","
return s[:-1]

if __name__=="__main__":
print arrangeForBookPrinting(int(sys.argv[1]))

The program takes the number of pages as an argument (non-multiples of 4 are accepted, but the program rounds it up.)

To process the printing, I use page-crunch, a GUI utility front end to psutils that lets you print a document in any order.