Binary Static

Interleaving two PDF files…

Posted in Applications, Hacking, Linux by Chris on October 17, 2010

Lightbulb…with no scripting required.  You’ll need the pdftk package though.  Say you’ve got a PDF file that has a two-sided layout and you want to trim the pages.  You could do this with pdfnup — however, your file may cut off from the even pages what it adds to the odd ones.  What now?  The solution is simple:

1. Use pdftk to split the file in even and odd pages seperately:

pdftk in.pdf cat 1-endeven output out.even.pdf
pdftk in.pdf cat 1-endodd output out.odd.pdf

2. Now would be the time to apply some pdfnup trimming magic to the two new files.

3. Use pdftk to burst these two files into single pages:

pdftk out.odd.pdf burst output %04d_A.pdf
pdftk out.even.pdf burst output %04d_B.pdf

4. Use pdftk to merge the pages back into one file, e.g.:

pdftk *.pdf cat output out.pdf

The important point here lies in step 3 when appending A or B to the odd and even page file names, because this allows glob sorting the pages like 0001_A.pdf 0001_B.pdf 0002_A.pdf 0002_B.pdf and so on.  I can’t believe I started to write a script before I realized how to solve this the simple way…

Tagged with: , , ,

Recent Chromium build for Ubuntu introduces extensions and bookmarks sync

Posted in Google, Linux, Web by Chris on November 17, 2009

… but kills essential development features (which didn’t work anyway). Chromium (Ubuntu build 32056) was distributed via Launchpad the other day. There is no official repository for extensions yet. However, you may find other resources to mess with your browser. The syncing feature seems still somewhat immature, since your stuff will actually sync with a Google Docs document – and not with Google Bookmarks or another well established service like which would seem more plausible. Anyway, syncing via Google Docs works o.k., if all you want is to work with instances of Chromium across different machines. Since I still need Firefox from time to time, I prefer the Delicious bookmarklet to Chrome’s new built-in sync. And why would I still need Firefox? There’s still no serious web development on (Ubuntu) Linux with Chrome – which is too bad, really. The scripting console didn’t work before, and now Google seems to have killed the relevant entry in the developer tools menu. This is no solution, of course. OK, so in a new build I got the menu entries back – but there is still no chrome://devtools/devtools.html. Please Chromium Team, Firebug in all its glory is the one extension that ties me to Firefox (yeah, I know about Firebug Lite). I could easily dispense with the rest and work with javascript bookmarks for other vital functionality.

Tagged with: , , , ,