Manipulate PDF documents with JavaScript

So, after splitting each page of the document into two pages, I had another problem. Somehow, the pages had gotten out of order. Don’t ask me how it happened, but I needed to swap every other pair of pages, for a ~400 page document.

Turns out, Acrobat provides a scripting language (uses JavaScript syntax) that allows you to create buttons that do something, forms that auto-complete, and most importantly (for me) batch scripts that create or modify documents.

Basically, I read this and this, then I pasted the following into the interactive debugger, and hit ctrl-enter. If I had ever wanted to do this on multiple files, I could have saved it as a batch script:

var filename = this.path;
console.println("filename = "+filename);
for ( var i = 4; i < this.numPages; i+=4 )
{
   this.insertPages(i,filename,i+2);
   this.deletePages(i+3);
   console.println("Pages "+i+"-"+(i+3));
}

Split one PDF Page into Two Pages

I think I’m going to attempt to make more use of this blog as somewhere to record the cool things I learn. I’m sure at least some of you have had this problem:

  1. You scan in a file two pages at a time.
  2. The pages are a little skewed, but the two pages are skewed a little differently.
  3. OCR doesn’t work too well.

The solution to this problem was found here. In short, you print to PDF using Acrobat. Then, in the print options specify to “Tile Large Pages”. Look at the preview image, and adjust the margins and scaling so the split happens in the appropriate place. Hit print, and save as another file. Then, run OCR on that new file. The pages can then be deskewed separately. PRETTY NIFTY!

Building The josIpod (part III)

The grand finale, peoples!  Enjoy:

THE IPHONE/IPOD TOUCH APPS THAT I CANNOT LIVE WITHOUT

Dropbox is the ultimate flashdrive-in-the-sky system — WITH A MOBILE APP!!!  If you’re like me, you have about 30 different computers that you use — depending on your mood, location, and which computers your classmates and family members are busy using.  If you’re like me, you also are pretty darn afraid of using thumb drives because of their slow speed, risk of data corruption (I’ve actually had a mis-configured windows XP box “eat” my homework before), and “misplaceability.”  Dropbox creates a folder on your local hard drive that gets automatically sync’ed with all of your other computers.  The iPhone app can’t edit the files, of course, but it can download documents for offline viewing — perfect for reading papers or homework assignments on the bus, for instance.  My only complaint is that unlike AirSharing, the DropBox app does not allow users to open web archives.  But, it’s intuitive and flexible interface with the computer  makes it a definite must-have.

I really do wonder how I survived before the Pandora Radio application hit the app store.  High-quality streaming radio that plays only the music that you like — for free!  I really don’t need to say anything more.  I know you’re all pretty annoyed at the audio/video advertisements on the website, but there seem to be significantly fewer such ads on the app.  You can even get around the 40 hour/month listening limit if you alternate between a couple of different accounts!  Or, for a change, you can listen to the slightly less reliable (in my opinion) last.fm application.

I’ve used a variety of Bible applications in the past, but in my opinion, Pocket Bible by Laridian Electronic Publishing is by far the most intuitive, full-featured, and functional app out there.  If you’re looking for something snappier and easier to use than Mantis Bible Study, but something with a bit more substance than YouVersion Holy Bible, then Pocket Bible is the perfect Bible Study tool for you.  It’s got notes, highlighting, search tools, free commentaries, and all kinds of other goodies.  The super-slick reading interface makes it easy to quickly flip through a chapter or to switch between several open books.  I’m still trying to carry God’s Word in my heart, but I for one am glad that it’s now available in my pocket as well. ;-)

Anyone with access to a XENAPP server such as the University of Iowa’s virtualdesktop system (which allows users access to expensive licensed software such as Dreamweaver, Mathematica, and Adobe Photoshop), will know how excited I was to find the Citrix Receiver application in the app store.  After some reading on the Citrix website and a conversation with the University ITS staff, I was able to connect from my iPod touch.  I contacted the ITS department with a suggestion that they add a help page similar to this to their site so that everyone else at the University could take advantage of this awesome service.  C’mon fellow students… this means MATHEMATICA ON THE IPHONE!

Last time I checked (which was admittedly a long time ago), Dictionary.com was the ONLY free dictionary/thesaurus application which does not require an internet connection.  Plus, it doesn’t even have all the annoying advertisements that you will find on the official website!  And yes, reading the dictionary IS my idea of a good time.

MochaSoft RDP lite is a full-featured Windows Remote Desktop client.  I’m not sure why, but RDP feels significantly more responsive than the VNC lite client by the same company.  Using this in conjunction with a free Dynamic DNS service makes truly mobile computing a breeze.

I’m too cheap to buy a Kindle, and I’m still protesting the silly name and enormous size of the iPad.  But, I don’t need them! — because I’ve got Stanza.  The app is so full of features, and the interface is so clean that I really feel no need to try anything else.  Just to give you an idea of how fun Stanza is, I was able to read Middlemarch, by George Eliot ALL THE WAY THROUGH (for those of you who know me, finishing anything — much less a book — is a big deal for me).

When Happy Maau Studios released their MathRef Free, my engineering study was instantly made a WHOLE lot happier.  No longer was I stuck with memorizing (and forgetting) the same trigonometric identities, calculus tricks, and math definitions over and over again.  No longer did I have to walk around with (and lose) stacks of ill-organized notes.  If I can just manage not to lose my trusty iPod for another year, I think I’ll be set!

This concludes MY list of the most essential apps ever.  If anyone has any suggestions/additions I’d be happy to hear about them!

Building the josIpod (Part I)

Hey folks, I’m taking a short break from my studies.  With the advent of the bigger and… mostly just bigger iPod for giants, I thought it would be a good idea to do a little series on some of the normal-sized applications that have made Josiah’s well-used first-generation iPod touch (aka The josIpod) the awesomely fun and still-totally-useful device that it is.  So, without any further ado, here is Part 1, alternately titled

Apps That I’d Really Like To Use If They Actually Worked


Instapaper is a pretty useful little tool — if the only information you need to download for offline viewing is contained in a simple HTML webpage.  The interface is a little clunky (you have to navigate to the page you want to download in Safari, then click a bookmark that executes some Javascript, then navigate to the application, and click the download button), but it’s usable.  The main reason I don’t use this application all the time is that it does not allow you to download PDF files, raw images, pages with frames, or anything else that is not contained in a simple HTML page.  I’m not sure why they didn’t just write a simple in-application browser with a “save this page” button…

Quicken is the site that I use to keep track of all my financial transactions.  Despite it’s several bugs, the site is able to automatically connect with my bank, and provides a quick and secure way to keep up an electronic “checkbook.”  The app claims to be an optimized interface to the site, but it has far too few features to be really usable.  For instance, it cannot edit previous entries.

Remember the Milk was one of my absolute favorite “To-Do” list services on the whole Internet.  You can categorize items, set up reminders, and it will save all your previous entries.  It WAS among my favorites, that is, until the company came out with one of the most infuriating applications in the app store.  It’s a close call, but I think it’s almost a match for Stephen Wolfram’s outrageous $50.00 interface to a website which can be accessed for free via Safari.  Why, instead of simply putting a price-tag on their application, RTM allows users to download the app from iTunes for no charge — and THEN requires them to pay a $25.00 fee to enable this very UN-free application.  Even that wouldn’t be so bad if users weren’t made to pay that fee again and again and again EVERY SINGLE YEAR.

For those of you who are wondering why there are only three applications on this list instead of bazillions, just be grateful that I don’t have time to list ALL of the underachieving applications I have downloaded and then immediately deleted.

For those of you who are looking for something a bit more positive, tune in next time for Part 2 (Apps That Aren’t Useful But Get Used a Lot Anyway)!