Search This Blog

Saturday, March 3, 2007

From ff.net to ebook for the PDA

Hi there!

Ever had your back hurting from sitting in front of the computer for too long, reading stories on fanfiction.net or fictionpress.com? I for one had, so I decided to use my Pocket PC as an ebook reader. After a lot of tries and errors I found the best way to move the stories to my PocketPC is to download everything, combine the different chapters in a single file and export them in tagged PDF format.

For everyone not familiar with PDF, it's an open, print orientated document format. The "tagged" part means that paragraphs and pages have special markers, so the reader application knows which parts should stay together, and where it is allowed to enter line breaks. Normal PDFs don't have that kind of markup, which will have you scrolling left and right like a berserk, which seriously dulls the whole reading experience. Though the Adobe Reader for PocketPC/Windows Mobile can tag documents when you copy them to the device via Microsoft ActiveSync, this doesn't work very well (in fact, it often chokes on bigger docs) so I don't recommend this.

I've also found that just copying+pasting into a document often leads to strange font interpretations, which in turn lead to error messages or crashes on the PDA.

So what I do is the following:
  • Download all the chapters lokally;
  • Extract only the story parts, without all the fancy JavaScript parts
  • Convert everything to UTF-8 charset
  • Combine all chapters into a single HTML document
  • Open the HTML file with OpenOffice.org writer (Version 2)
  • Export to PDF with the "Create tagged PDF" option enabled
Of course, being a computer programmer, the first four steps were a lot too tedious for my taste, so I wrote a small Perl application that does it for me and only needs the story id and the output filename for the HTML. It can't be found online, but if you need it, let me know.

No comments: