Thread: The PDF reader
View Single Post
RogerS's Avatar
Posts: 772 | Thanked: 183 times | Joined on Jul 2005 @ Montclair, NJ (NYC suburbs)
#1
Usually, I steer clear of PDF files, especially on the Nokia N800 and 770 Internet Tablets. Documents are almost always designed for letter-size pages, and I don't read text where I have to scroll sideways as well as up-and-down. This week, however, the N800's PDF Reader was my salvation. The app is better -- faster, more stable -- than I expected but ignores hyperlinking.

When I read text on a Nokia Internet Tablet, I prefer FBReader to the alternatives. Usually I'll be able to convert my text to the FB2 markup (this is simply XML, not a proprietary or binary format), and FBReader lets me pick fonts and sizes by XML element, so I can arrange this to my finicky satisfaction. And I prefer to page through text using the + and - keys on top of the NIT.

I had chapters of the book in html files, but no time for an html-to-fb2 transformation. So I grabbed a pdb I'd made a while back, since that's the prime alternative among the many formats that FBReader will display.

The book is entitled "How to Think Like a Computer Scientist: Learning with Python," written by Allen Downey, Jeffrey Elkner and Chris Meyers. I was skimming through the text when I was stopped by a code example.

Here's a screen capture from the N800:

Well, the code example isn't stylable by FBReader in pdb format, but if you can't see the indents in Python examples, then you're missing something.

I found the book online at ibiblio.org and then used Adobe Acrobat's feature for making a PDF from web pages with one key setting -- making a custom page size 6 inches wide by 3.6 inches tall.

Opening this PDF, I set the page zoom to "fit page width" and got this sort of thing instead:

As you can see, not only are the lines indented, the code is in a different font and keywords in a different color. All that's been lost in the quick-and-dirty pdb.

I experimented with a few different ways to make the PDF. I found my most successful result by downloading each html chapter, modifying the css stylesheet to choose Trebuchet MS as the font and 16 pt as the font size, then making a PDF of the chapter. (When I did the whole book from the website, the font size wasn't consistent throughout the chapters, why, I don't know.)

That experimentation led me to discover one flaw in the PDF reader -- the Open dialog doesn't display enough characters in a file name. Here are two screen shots showing my chapter file tests in the recent files list and in the Open dialog:

To be honest, I figured a 1135-page PDF would be too unwieldy for the reader to manage, so I started out making individual chapter files from my local html copies. Since the links weren't relative, I used the complete online version to make a single PDF of everything, with the Table of Contents and Index linking to different chapters.

To my surprise, the progress through the pages of this huge document was no slower than through the small single-chapter documents.

The links worked fine on my laptop, but not at all in the NIT's PDF Reader. Navigation in such a huge document is really awkward without being able to use the links or bookmarks. Anyone know more about the linking issue with PDFs?

— Roger Sperberg

For those who are interested, the PDF can be downloaded from here

Added later: Translations of this text into Portuguese and German are also available, as is a paper version from Green Tea Press. The first version by Allen Downey was written with Java examples and then a version rewritten by him for C++. The same clear-headed text was then modified to introduce Python and Logo. I like this book and as its title indicates, in order to learn to think like a computer scientist, you will also need to learn to think like a computer and also, hopefully, simply how to think.
Read the full article.