Feb 21, '05 08:52:00AM • Contributed by: DougEdwards47
The number of pages in the booklet is known as the signature of the book. For example, a booklet of signature 8 will print onto two sheets (front and back) in the following order:
- Sheet 1 front side: pages 8 and 1
- Sheet 1 reverse side: pages 2 and 7
- Sheet 2 front side: pages 6 and 3
- Sheet 2 reverse side: pages 4 and 5.
I came to write this script because I had suggested to my wife that she use Pages for producing her local Church magazine. She had a look and said it was no good because it couldn't produce booklet format, unlike MS Publisher. Thinking about it, I realised that this ability should not be wired into the application, but should be part of the printing infrastructure available to all applications.
In the Unix world, there is a set of PostScript utilities, psutils, that can be used to manipulate any PostScript document and can be used to produce a Booklet layout. Unfortunately, most of the programs in psutils do not work well with CUPS. However, most of the functionality of psutils can be obtained by passing options to CUPS -- all except psbook, which does the rearrangement of pages. This is presumably why there is no booklet layout option in print dialogues. Fortunately, psbook is the one utility that appears not to break CUPS.
- Install a copy of psutils (obtainable from Fink). Actually, the only program you need is psbook.
- Copy this perl script into /Library -> PDF Services -> 8pBook or the same spot in your user's Library. You can, of course, change the name of the file to whatever you choose.
- You should now see '8pBook' as an option when clicking on the "Save as PDF" button in the print dialogue. Selecting the option will cause the document to be sent to the named printer in an 8-signature booklet form. The name of the printer, number of copies and collation options are preserved, although the script may break if the printer name has a space in it.
- To allow different signatures, change the value of the variable $Sig and save the file under a different name. It would be nice to be able to pass the signature as a parameter, but I can't think of a clean way of doing this.
