PocketMod and pstops

The joys of Unix are the versatile tools available. The downside of many of these tools is their usability. A role model for this general observation is pstops. It allows to rearrange Postscript pages according to any order and rotation you like (well, ok, rotation by 90° steps), mostly in order to prepare documents for printing, such as brochures. The versatility comes at a cost, though. First, the notation is a bit terse. I won't go into the details, you can have a look at the man page to see what I mean. Second, adjusting the rotation and shifting requires some geometric thinking. As the rotation is around a corner and happens prior to translation, pages are rotated "out of sight" if not translated, and people lacking discipline in geometric thinking (such as me) are bound to applying trial and error.

Once I have succeeded I am so overjoyed I want to tell the interwebs about it. The application I had in mind is the PocketMod style of folding up a paper printed single-sided to a small 8 side brochure. I tried out the application on the PocketMod homepage but it didn't match my needs. First, you need Flash installed, which is often a bad sign. Then, the stuff you create is ephemeral, at least I have not seen any possibility to download and save your work for later reference. Third, non-ASCII characters are ignored in output. Fourth, the output is, instead of A4 paper, on some local format which I don't have paper for. Fifth, the output is in some pixel graphic format.

Buying into the Unix way to split a tasks into subtasks, I thought about making some Postscript file myself (ok; some PDF file, then converting to Postscript), then applying pstops to rearrange and then to reconvert to PDF. That's one of my other gripes with pstops: That there is no wrapper (I am aware of) for PDF documents. Obviously the tenet is that people who can master pstops don't see any hassle in converting; or they can write their wrappers themselves. Sometimes I want to be pampered though.

Anyway, here is the syntax:

pstops "8:1L@.35(10.5cm,0)+2L@.35(10.5cm,7.425cm)+3L@.35(10.5cm,14.85cm)+4L@.35(10.5cm,22.275cm)+0R@.35(10.5cm,7.425cm)+7R@.35(10.5cm,14.85cm)+6R@.35(10.5cm,22.275cm)+5R@.35(10.5cm,29.70cm)" document.ps document-pocketmod.ps

This is another gripe I have. The pstops manual neglects to tell the users that the arranging specs have to be wrapped in quotes in order to be parsed in bash. Yes, I know that's shell-specific, but I think it wouldn't hurt to mention that in some shells the quotes are required.

Add a New Comment
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License