Mozilla planning to use HTML5 and JavaScript to render PDFs in Firefox

Mozilla planning to use HTML5 and JavaScript to render PDFs in Firefox

Summary: This is really cool, and a really good idea. Mozilla is working on a project that will allow PDF documents to be rendered within the browser using HTML5 and JavaScript as opposed to having to rely on a separate plug-in.

SHARE:

This is really cool, and a really good idea. Mozilla is working on a project that will allow PDF documents to be rendered within the browser using HTML5 and JavaScript as opposed to having to rely on a separate plug-in.

Mozilla researcher Dr. Andreas Gal, working on JavaScript and Web research, spills the beans:

We have been developing pdf.js in the open (on github.com), albeit quietly, for about a month now. We were waiting on the completion of some major features (Type1 fonts, gradients, etc.) before communicating pdf.js more broadly. We've been taken by surprise by the early and intense interest in our work, so we decided to blog and talk about our project earlier than we initially planned.

This is a truly awesome idea. It has so many benefits that it's a total no-brainer. Not only does it remove the need for a third-party plug-in or readers, but the built-in reader can also leverage web features such as HTTP range requests. On top of that it also means a unified user interface for dealing with PDFs, and possibly makes handling PDFs found on the web a lot safer as the documents can all be sandboxed within the browser. Also, the open-source nature of the implementation should make is more secure (more eyes on the code and all that).

This could also be an awesome feature for mobile platforms.

Check out pdf.js in action here. It's not perfect but it's still pretty neat and shows a lot of potential.

Bottom line, it's a feature all modern browsers should have.

Topics: Open Source, Browser, Software Development

Kick off your day with ZDNet's daily email newsletter. It's the freshest tech news and opinion, served hot. Get it.

Talkback

16 comments
Log in or register to join the discussion
  • RE: Mozilla planning to use HTML5 and JavaScript to render PDFs in Firefox

    In Chrome the text rendering is ugly and hard to read.

    In IE9 it doesn't work.

    Think I'll stick with my plug-in thanks.
    jhughesy
    • Not finished Yet

      @jhughesy
      Dude/dudette, it's still in development..
      My goodness, would you go to the bike factory and say that you don't want a bike just by looking at an empty frame?
      Michael Lam
      • And, for Macs, it is not needed since PDF renderer is built in the OS

        @Michael Lam: there is no issue; it is the same with iOS.
        DDERSSS
    • Given IEs poor HTML5 support it's not surprising

      Stick with the plugin, it's not like it has had security issues in the past nor requires elevated permissions to install. Oh wait;-)
      Richard Flude
  • RE: Mozilla planning to use HTML5 and JavaScript to render PDFs in Firefox

    The only way I would like this is if I could still save the pdf once I see it, in its native format, in its original quality, to open at anytime I want in Acrobat, without having to keep downloading it on the 'Net. I'd also want to be able to print it in with its original quality too. So this new system has so real challenges.
    NSL
    • RE: Mozilla planning to use HTML5 and JavaScript to render PDFs in Firefox

      @NSL
      Thse features you request are no problem, since PDF format is just a markup language itself. You will be able to use the Adobe plugin (or alternatives) if you desire.
      x I'm tc
  • This is kind of goofy

    PDF is a page description language, purposed in its existence for the precision placement of graphic objects and by its nature uninterested in document content: it is so incompatible in its very goals with HTML that what is sure to result is a horrific kludge.

    A much better approach would be to (in javascript or otherwise), interpret the PDF to SVG, and then use Firefox's innate SVG viewing capabilities to view the resulting file.
    Mac_PC_FenceSitter
    • RE: Mozilla planning to use HTML5 and JavaScript to render PDFs in Firefox

      @rbethell
      Modern HTML provides subpixel specific content placement.
      x I'm tc
      • RE: Mozilla planning to use HTML5 and JavaScript to render PDFs in Firefox

        @jdakula Even with canvas HTML5-sans-SVG lacks SVG's ability to fill, gradient, stroke, and perform font effects to the same degree. SVG is the logical way to go - it is a more directly analogous technology.
        Mac_PC_FenceSitter
    • RE: Mozilla planning to use HTML5 and JavaScript to render PDFs in Firefox

      @rbethell
      The trouble I experimented with PDF to SVG conversion, is the big size of the resulting SVG (even with GZ compression), of course Binary XML with compression could come to the rescue but the browsers are not supporting it yet.
      Fox-Info
  • RE: Mozilla planning to use HTML5 and JavaScript to render PDFs in Firefox

    As long as it isn't as bloated as Acrobat reader and renders the PDF file a lot faster I'm all for it. Trying to load a PDF through a web browser using Acrobat plugin is just painful
    LoverockDavidson
    • RE: Mozilla planning to use HTML5 and JavaScript to render PDFs in Firefox

      @LoverockDavidson

      Could not agree more its shocking, I do wonder how adobe can continue to churn out the rubbish which is Adobe reader and adobe flash player
      the.nameless.drifter
    • RE: Mozilla planning to use HTML5 and JavaScript to render PDFs in Firefox

      @LoverockDavidson

      Also agreed. I quit the plugin route entirely and open PDFs externally by having Firefox go through Windows to call up a lightweight PDF reader app on my own system -- it's still faster than using the in-browser Adobe Reader plugin.
      The One True Fnerd
  • It's everywhere

    I plan to code a real-time stellar evolution model in HTML5 and JavaScript.
    Robert Hahn
    • RE: Mozilla planning to use HTML5 and JavaScript to render PDFs in Firefox

      @Robert Hahn Ha!
      sackbut
  • RE: Mozilla planning to use HTML5 and JavaScript to render PDFs in Firefox

    acrobat reader can cause problems with browsers so this should be helpful.
    opcom