Showing posts with label ereader. Show all posts
Showing posts with label ereader. Show all posts

Tuesday, March 12, 2013

Creating PDFs for EBrary Reader

Turns out that Brown has a subscription to at least part of the Ebrary archive of online books. I found this out because I was looking for a book in our library, using the online catalog, and it turned out that said book was available online. Very cool!

Well, kind of cool, until I found out what this involved. By default, you basically have to read the document online. You can download the "EBrary Reader", which is a Java application, and read documents using it. But it's kind of clunky, to say the least. What I wanted was a PDF that I could then use as I wanted. How to get one?

I noticed that the EBrary Reader would allow me to print, so I thought maybe I could print the file as a PDF, since the default print dialog for Fedora lets you do that. Unfortunately, the Java application was not using the system dialog, but a Java dialog, so that didn't work.

A little googling led me to the cups-pdf package, which installs a system-wide PDF printer for the Common Unix Printing System. A quick "sudo yum install cups-pdf" was enough to give me access to that.

The next step was to convert this file to DjVu, which tends to be much smaller than the corresponding PDF. I've done this a million times before, so figured it would be pretty easy. Unfortunately, it was not.

The first step was to run the pdfimages command (from the poppler-utils package):
pdfimages -p file.pdf p
to extract the page images. Imagine my surprise when I got 420 images from a 20 page paper! It turned out that each page was constructed from 21 different images, stacked on top of each other. (To help with download times?)

Fortunately, I've had enough experience with ImageMagick to know this was not a problem that could not be solved. It took a little more googling, and a little experimentation, but eventually I found out that:
for i in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20; do
  montage p-0${i}*.ppm -geometry +0+0 -background none -tile 1x21 page-$i.tiff;
done
would stack all the images back on top of each other.

So now I had 20 page images, all as TIFFs, and those could then be fed to ScanTailor for processing on the way to creating a DjVu.

Wednesday, January 30, 2013

EBookDroid

For a while now, I've been trying not to print out copies of papers I'm using for class. I had a Kindle DX a while back, and I tried loading PDFs of papers into it. But the page rendering was so slow it was painful, and a real problem in class itself, since finding a particular passage would simply take too long.
More recently, I've acquired a Samsung Galaxy Tab 10.1, which makes for an excellent e-reader. It has a nice, bright screen, good resolution (1280x800), and lots of memory. Plus, I can access my course web site, or JSTOR, or whatever, directly from it (and with tools like AndFTP, I can even access my servers using SFTP and public key authentication).
But as I've mentioned elsewhere, a lot of the material I've scanned for my own use is in DjVu format, so I recently found myself needing to find a DjVu reader for Android.
It turns out (unsurprisingly, really) that there are several options, but the one on which I've settled for now is EBookDroid, a free and open source (GPL'd) ereader. Not only does it handle DjVu, it's got a lot of other nice features, such as the ability to set lots of named bookmarks (making particular passages easy to find). But one of the nicest things about it is that it will automatically split pages, if the file you are reading happens to have facing pages on a single page, like a photocopy. And it will automatically scale pages to the content area, not to mention wash your laundry and make your dinner. An excellent tool.
I've seen some people mention that EBookDroid "hijacks" PDF links from the browser, but I have not seen this issue myself. It does register itself as one possible PDF reader, but that is all.