The GlobalMentor Ebook Reader is Back

Almost exactly a decade ago, I and my company, GlobalMentor, Inc., were part of a group of organizations that defined the modern ebook industry. As part of the Open eBook Forum, now the International Digital Publishing Forum (IDPF), we created a specification that have recently become popular on the newest reading devices from companies like Sony. I was development co-chair of the OEBPS 1.2, before it became known as EPUB, and I developed and released the first publicly available native OEB reading software.

I was ahead of my time. Although the GlobalMentor Reader software was powerful enough that GlobalMentor released with John Wiley & Sons the most interactive OEB ebook available, the state of the economy put a damper on any momentum ebooks had. I turned to other things, most recently genomic visualization software, and the GlobalMentor Reader languished.

But recently there has been a glimmer of movement in the ebook world. Last month Sony announced EPUB as the main format in their ebook readers. A few days later, Google announced the availability of over a million public-domain books in the EPUB format. I started getting requests to make available again the over 5,000 public-domain books I released in OEB format back in 2002. I felt it was time to dust off some of the old code and make it available, since the world seemed to be coming around.

Today I released a new version of the GlobalMentor Reader that works with the latest version of Java. You can launch the Reader directly from that web page. Furthermore, I've made available as open source the bulk of GlobalMentor's Java library, including the core processing of the GlobalMentor Reader. To give you an idea of how extensive this library is, consider that Java's native Swing text processing components don't even handle HTML 4—yet GlobalMentor's Swing text extensions (and the GlobalMentor Reader) process general XML with general CSS markup, with OEB/EPUB being just one particular flavor of data it can render. As far as I know, there exists no other Java Swing text extension that come close to this sort of power—and this code was mainly completed around eight years ago.

The years waiting have been beneficial, however. An increase in processing power means that the Reader loads and displays ebooks much more quickly than it did back then. Furthermore, Java has integrated more support for internationalization, fonts, and font smoothing, obviating the need to copy whole-cloth entire sections of Sun's source code just to hack in a few fixes. And because I've spent years creating Guise™, a web user interface framework; and marmox.net, a web content management engine; I've been able to launch GlobalMentor's new web site and the GlobalMentor Reader on Marmox (which also runs this site).

But all the "improvements" haven't been easy. When I first wrote the GlobalMentor Reader, the available XML parsing was so slow that I opted to build my own XML parser from scratch, making it likely quicker even than those available today. But maintaining an XML parser and ensuring it passes test suites to handle obscure cases is too much work, so with the new release of the Reader I converted the XML parsing code to use the XML parsers now built into the latest versions of Java.

Compiling to use the new parsers was not too difficult, as I had made sure that my custom parser implemented the W3C Document Object Model (DOM) when I wrote it. But relying on other people's code is always something of a risk. As soon as I switched parsers and tried to load up the Wiley book in the Reader, the code threw a NullPointerException in the middle of Sun's version of the Apache Xerces parsing code. It turns out that others have complained about this before; it has been raised on the Apache bug list; and it even resulted in an official Java bug report—back in 2004! Sun's response? "Will Not Fix." Yes, that's right—if you use Java's default XML parser, even in the latest version of Java, and don't use an esoteric workaround (explained in the links above), your parser could randomly throw NullPointerExceptions, and Sun has no intention of fixing it.

With those hiccups out of the way, the new GlobalMentor site has been launched (slightly ugly but highly functional, running on marmox.net and backed by Subversion) and the GlobalMentor Reader is available once again. GlobalMentor's ebook processing and visualization library is available as open source. And soon I hope to distribute once again the Project Gutenberg books in OEB/EPUB format.

The GlobalMentor Reader currently only supports works at the level it did when it was first released: OEBPS 1.2. Soon I hope to make the adjustments to allow the Reader to handle the minor changes that came with release of the IDPF's EPUB specification, formerly known as OEBPS 2.0. And if time permits (or somebody gives me the money to devote more time to this), the GlobalMentor Reader could turn into the general XML+CSS browser and editor that it was designed to be back in 2001.