2007-01-24 Pocketmod Do It Yourself

I’m sure you must have heard of the PocketMod stuff by now. What if you wanted to make it yourself? There are some tools out there. One I know is a Flash application that only allows you to pick from the pages it comes with. The other I know is a Dot Net port that I don’t want to use. And recently I’ve seen one that will only work on Mac OS 10.4 (I still run 10.3 on my laptop) and it comes with an expiry date that coincides with the release of Mac OS 10.5. How weird is that?

PocketMod

Enters the command-line!!

~/Desktop $ pdf2ps tengu.pdf
~/Desktop $ pocketmod tengu.ps tengu-pocket.ps
[1] [2] Wrote 2 pages, 36939974 bytes
~/Desktop $ ps2pdf tengu-pocket.ps

So, what happens in the `pocketmod` script?

#!/bin/sh
1. The following pstops command will reorder the pages of a
1. postscript file into a single page foldable pocket organiser.
pstops -d "8:0L@0.3536(297.5,631.5)+\
1R@0.3536(297.5,842.0)\
+2R@0.3536(297.5,631.5)\
+3R@0.3536(297.5,421.0)\
+4R@0.3536(297.5,210.5)\
+5L@0.3536(297.5,0.0)\
+6L@0.3536(297.5,210.5)\
+7L@0.3536(297.5,421.0)" "$@"

(Make sure the huge parameter doesn’t have any whitespace in it!)

Via the PagePacker announcement on FreeMacWare ¹, the comment by Ed on the PagePacker page ², a comment on LifeHacker ³ and a post on “Cool, but useless.” ⁴…

FreeMacWare

¹

²

LifeHacker

³

​#Software

Comments

(Please contact me if you want to remove your comment.)

Oh that’s very cool indeed! Well found, Alex. That’s given me one more reason less to reboot into XP. Always a blessing 😄

Thanks for sharing.

– GreyWulf 2007-01-24 14:35 UTC

GreyWulf

---

I thought of you when I found this note! 😄

`pstops` is quite cool, actually. The package should be called PSUtils if you don’t have it. Probably you can do the same thing with pdftk. Except I don’t know how. ;)

PSUtils

pdftk

I bet you can also use unholy paper formats by combining `-p` to specify another format with relative units instead of PS points in the shifting instructions (the part in parenthesis): “*xoff* and *yoff* are in PostScript’s points, but may be followed by the units ’cm’ or ’in’ to convert to centimetres or inches, or the flags ’w’ or ’h’ to specify as a multiple of the width or height.”

– Alex Schroeder 2007-01-24 15:14 UTC

Alex Schroeder

---

I’ve tried with pdftk and didn’t manage to get the pages rotated in the right places. More attempts needed, methinks. Meantime, converting to *ps* and back again is a good (and arguably more powerful) solution. I like.

As all of the apps in psutils are pipe-friendly, you could just use:

pdf2ps filename.pdf -|pocketmod|ps2pdf - filename-pocket.pdf

(note the cool use of - to denote input and output streams)

– GreyWulf 2007-01-24 15:57 UTC

GreyWulf

---

By the way: Getting the pdftk binaries for OSX and using them to remove password protection from some PDFs (notably password protected web-enhancements I downloaded) worked really well.

– Alex Schroeder 2007-07-12 20:39 UTC

Alex Schroeder