back
90 comments
I'm really excited for this for http://www.sharelatex.com and other similar sites that are actually generating a PDF for you. With native PDF viewers there is no way to interact with the viewer via javascript and even just having the viewer stay on the same page when your reload a document (with minor changes) is impossible. Pdf.js means that we'll be able to do this easily, as well as other cool things like letting letting the user sync between the PDF and source.
Our web-based IDE[1] does exactly this, including syncing between source and PDF, using PDF.js. Works great for the most part!

[1] http://rstudio.org

I used to use PDF.js for a while (on Linux), until I switched to KParts because it was having difficulty rendering certain kinds of PDF documents. KParts uses the same underlying engine that powers Okular (KDE's default PDF reader.) It renders everything properly and is much faster than PDF.js. It reminded me of Foxit on Windows. KParts might be only available on Linux though...
I use this a lot, and it really does work. It renders everything, and renders it well. The one thing that doesn't work is maps – just too many vectors, and Javascript/Canvas/etc just can't keep up. Otherwise I'm very happy and don't feel nearly as much resentment towards PDFs as I used to.
(I assume you are you mentally comparing pdf.js to Adobe Reader.)

Have we reached the point where Adobe Reader is so resource-guzzling that people prefer a JavaScript (gasp!) PDF interpreter to Reader? Wow.

Yes, I really love PDF.js. I was consider switching to Chrome just because of the (proprietary) pdf viewer. But the Chrome PDF viewer even lacks the concept of pages! I had already kicked out the Adobe Reader plugin but using an external viewer every time makes PDF just so more annoying.

Mozilla is also working on something similar for Flash: https://github.com/mozilla/shumway . I'm a bit sceptical but with the success of PDF.js I can't wait to use it.

Another Ian here, also using pdf.js. Been working on a paperless office app that allows contracts to be signed on an iPad. It works surprisingly well.
Firefox already bundles the pdf.js reader. See https://bugzil.la/714712.
Two questions:

1) In Firefox 15, the demo page adds two new options to my right click menu: Rotate clockwise and Rotate Counter-clockwise. Is Firefox recognizing pdf.js (since it appears that they are related) or pdf.js adding menu options? I didn't know JS could do that.

2) Isn't Javascript an embeddable language inside PDFs? I'm pretty sure I read that javascript is used, not necessarily for animations but for run-time dynamic layouts. If that's true, is pdf.js "eval"-ing that javascript?

This is super cool.

While I can't imagine myself using it anytime soon, it's clear that web applications are improving at a far faster rate then native applications and, with t large enough, the first derivative means that web will eclipse native.

This seems like an academic exercise at the moment; it's to prove that you can replicate a native experience only.

However, it seems that this could be vastly improved by playing to the strengths of the internet. The only online apps that have beat native ones so far have been because of cloud storage and collaboration. First, use filepicker.io or something so this can open my online files. Second, bake some collaboration into it.

GroupDocs currently provide an app for online annotation and collaboration, including accessing your files from different cloud storage providers, currently Azure & Amazon S3 are supported http://groupdocs.com/apps/annotation/try-it-now
XSS injections on these are gonna be fun..
I came across this a few months ago while trying to implement a solution for turning HTML into PDFs server side. This is definitely cool and useful but it's usefulness is limited for now as native PDF readers on the desktop are preferable. Even on iOS the built in reader is nicely done. Chrome on Windows and Mac always opens PDFs in a tab and handles it well I think. That said, this can definitely be of use in Chromebook type situations. I'm sure it'll end up in Firefox OS too which I have hi expectations for. The awesome thing about Firefox OS is that it's all JavaScript and good old fashioned web technologies under the hood so this will fit right in.

So alas, I'm still searching for an easy way to convert HTML to PDF server or client side. I haven't looked at the code yet but I do wonder if one could get that functionality out of this if they wrestled with it enough. (I know there are other ways to turn HTML to PDF but a client or server side script to do so really is the best solution for my situation).

This is about PDF to HTML conversion.
As a big user of PDF.js, I have to say it's great for basic PDF documents. However, complex vectors don't render nicely with this
Now if someone would just do this for .docx, .xlsx, and such I'd be set.
GroupDocs provides a commercial online viewer and API's for supporting those formats as well as .pdf
http://groupdocs.com/ seems to cope with a whole bunch of file formats.
Is there a way you could tell your browser to open those links in google docs by default?
I have first seen this a year ago (when it was publicly announced, IIRC). It was a cute tech demo but easily broken, and quite slow.

This ... is mind blowing.

Just as interesting, in my mind, is the inverse library -- jspdf [1] lets you create pdfs in javascript. For automatic document generation, I find I can quickly whip something up in jsbin or jsfiddle that will give me a pdf I can download and do whatever I want with.

[1] http://jspdf.com/

I presume that copy to clipboard could be added to this as well, yes? Cool project.
I have this error with Firefox 9.0.1:

currentPage is undefined http://mozilla.github.com/pdf.js/web/viewer.js Line 285

I'd go with "That's because any version of Firefox below 15 is unsupported".
You should update to Firefox 15. It's better than 9, and secure too.
i've stumbled upon PDF.js a while ago because i was looking for js tool that allows me to extract data from pdfs... sadly i'm still looking for a good lib to do just that.
If your looking for a web based API for manipulating PDF's, SaaSpose provide a commercially supported solution
Apache Tika. Works on many filetypes and languages.
iText has a lot of tools for extracting info from PDFs. We use it extensively.
This is great, I love it. I can read PDF files without leaving the browser, in any browser. I find it slightly distracting to switch to a third-party application.
from someone who has worked a lot with PDF, excellent work.
It's in Firefox since version Firefox 14, but disabled by default. Activable with "preview in Firefox" in options/filetypes/pdf.
Next up, a good ePub reader for use in firefox and firefoxos. Breaking free of the only two rendering engines in use...
On an iOS device with retina display it's awfully blurry, probably just not rendering to a big enough canvas.
Feels like they aren't taking window.devicePixelRatio into account so that they end up with a legitimately retina-sized canvas... My canvases were always blurry like this until I took dpr into account.
This is amazing, but sadly slow.
On linux, anything is better than that crappy 32-bit only propietary plugin that hangs the browser for a second every time I want to open a pdf file.
Works nicely since it is Firefox's default viewer. No more need to install a one, yay!
Sweet. Going to keep this in mind for when my site needs a pdf viewer. Awesome tool
This is pretty cool! Anyone knows if there is support for PDF annotations?
Looks like it has basic support for annotations, but is limited in its scope. I'm hoping I can use this to read annotations from PDFs so I can hook it into a journal paper reading/organisation workflow.
The demo looks really impressive, well done. Adding this to my toolbox! :)
On Firefox OS this will be the default PDF viewer.
Good Job!!
1) From a technical perspective, this is damn cool - exceedingly well done. Color me very impressed.

2) I hope I never actually see anyone using this on a website, attempting to make things "easier." Between Scribd and Slideshare, and Adobe trying to force its hideous crash-prone plugins into my browser, there are already enough people making a mess out of what is one of the more well-thought-out aspects of OS X. Give me a link to a PDF, which Preview.app handles in wonderful fashion any day.

3) It would make a sweet browser plugin on browser-in-a-box platforms and other platforms that don't have a nice native implementation (which upon further reading seems to be the goal).

Personally I wish all sites used this instead of scribd/slideshare or opening up external programs.

This will just work on different browsers, different OS etc.

Plus you can send links like this: http://mozilla.github.com/pdf.js/web/viewer.html#page=6&... To send a user to s specific part of the page. Right now usually you just send the pdf link and have to say, "check out the image on page 6".

Keeping the pdf in the browser and accessible to and from javascript opens up a world of possibilities.