Mozilla's pdf.js version 0.2: sample PDF now renders in HTML5, JavaScript

By on July 5, 2011, 4:00 PM

Mozilla's pdf.js project has reached its first milestone: a "pixel-perfect rendering" of a sample PDF (a paper on Mozilla's Tracemonkey JavaScript engine). Well, perfect in one specific browser and OS combination.

The pdf.js project currently produces different results depending on the browser and OS you are using. If you're running a Firefox nightly on a Windows 7 machine, where the browser can use Direct2D and DirectWrite, the result is perfection (assuming you ignore a bug in DirectWrite's font hinting). The paper isn't rendered so well on other platforms, nor on older versions Firefox. It's even worse in other browsers.

Nevertheless, some serious progress has been made, considering that the sample file contains formatted text, graphics, tables, and graphical diagrams. As a result, the project has been bumped to version 0.2.

The pdf.js project was announced last month, with the goal of not having to rely on plugins like Adobe Reader or Foxit Reader to display PDF files. Instead, the aim is to build a PDF reader in HTML5 and JavaScript.

The group will start by making a Firefox extension available to interested users that enables inline PDF rendering using pdf.js. The next step will be to ship pdf.js with Firefox. The team hopes this will result in a substantial usability and security improvement for Mozilla's users since pdf.js uses only safe web languages and doesn't contain any native code pieces attackers could exploit.

Last but not least, pdf.js will hopefully turn into a community driven and governed open-source project. It will be used in Firefox, but it will ideally also be ported to other browser and opened up for use in other applications. The project pdf.js is being licensed under a very liberal 3-clause BSD license and external contributors are welcome to join.

"We chose the pixel-perfect rendering of this paper as our first milestone because getting there required solving some hard problems, and it's easier to focus attention on one target," the pdf.js team said in a statement. "We want to prove that a competitive HTML5 PDF renderer really is feasible, and not just fun talk. Many more hard problems remain, but we haven't come across any so far that are so much harder than what we've already solved to make us rethink the viability of pdf.js."

Add New Comment

TechSpot Members
Login or sign up for free,
it takes about 30 seconds.
You may also...
Get complete access to the TechSpot community. Join thousands of technology enthusiasts that contribute and share knowledge in our forum. Get a private inbox, upload your own photo gallery and more.