Live data from Hacker News

Firefox introduces PDF viewer

blog.mozilla.org

41–50 of 200 posts

Re: Firefox introduces PDF viewer

#41
post #6

Love it, but unlike Chrome's embedded PDF reader, it can't "stream" PDFs (a dealbreaker for people viewing media-heavy PDFs on slower connections)

That's interesting, because PDFs are an inherently un-streamable format. It requires seeking within the file to work (hence why command line PDF tools can't take STDIN for the PDF file - or they fake it by copying to a temp file first). I wonder how google got around that problem.

Well, I imagine that they download the file in the background, and if the viewer seeks to a non-downloaded part of the file, then it just blocks with "Loading" until that part is downloaded.

Re: Firefox introduces PDF viewer

#43
If you want to try PDF.js from your current browser, here's a demo:

http://mozilla.github.com/pdf.js/web/viewer.html

I wonder what's keeping this so ugly in Chrome. Also, does anyone know if printing is intended to work? It doesn't appear to have the pagination right, again at least on Chrome.

Re: Firefox introduces PDF viewer

#44
I would love to have a PDF viewer app for OS X based on PDF.js. Better still if it could be sandboxed and have other enhanced security.

Just tried out Firefox 19, and the PDF reader is good. Responsive enough, with just the barest hint of render lag. Minor nit: Firefox isn't currently registered as handling PDF, but will still open it happily.

EDIT: I have Firefox as my OS X Mountain Lion's PDF viewer app now. Works quite well!

Re: Firefox introduces PDF viewer

#45
post #9

It's worth pointing out this is done in pure Javascript , and works by compiling PDF functions to equivalent Javascript functions which are then visible to Firefox's JIT. Despite being only around a year old, it still manages to render the majority of PDFs thrown at it (it's been my primary paper reader for the past 6 months or so). As for missing features like some complex gradients, I can't say I've missed them, ex…

> While Mozilla are pumping out stellar designs like this, Google are pushing crap like Native Client and their proprietary, binary-only Foxit Reader solution instead, complete with the hundreds of thousands of LOC of insecure C this entails. Rock on, Mozilla!

Why are you dumping on Google? Their browser has been able to handle PDFs for years (including forms!).

Re: Firefox introduces PDF viewer

#46
...and it displays your visited sites in a grand panorama on the canvas in a new tab, despite having asked for always private browsing.

It could be a regression of both the browser, and the unit test, which isn't such a good news.

Re: Firefox introduces PDF viewer

#47
post #6

Love it, but unlike Chrome's embedded PDF reader, it can't "stream" PDFs (a dealbreaker for people viewing media-heavy PDFs on slower connections)

That's interesting, because PDFs are an inherently un-streamable format. It requires seeking within the file to work (hence why command line PDF tools can't take STDIN for the PDF file - or they fake it by copying to a temp file first). I wonder how google got around that problem.

"Linearized" PDFs have extra info up front to allow streaming and random access (via range requests).

Re: Firefox introduces PDF viewer

#48

What I don't understand is why Google doesn't have an open source PDF viewer? I mean, Chromium renders OpenGL, decodes movies, contains fastest JavaScript VM and it cannot view PDFs? Given what they did to JavaScript speed, can you imagine what viewer they would be capable of producing of? At least they should join Mozilla on improving pdf.js, IMO...

Chrome already has its own PDF viewer, presumably implemented in C or C++ or whatever, so they probably don't care about making it available for Chromium. Perhaps they bought the rights to the source code they based it on, and are unable to open source it.

Re: Firefox introduces PDF viewer

#50
post #29

It's nice to have such an option, but it feels significantly less snappy than Kparts plugin in KDE which wraps Okular into Firefox.

True, as with plain Adobe Reader. I spend a large part of my day reading .PDFs, both in and out of my browser, and Firefox became a much less effective "power tool" when they took the liberty of disabling the Reader plugin. I couldn't care less how long it takes to load a .PDF -- snappy rendering and navigation is everything, and you don't get that from JavaScript.

It took a surprising (to me) amount of hacking to re-enable native .PDF rendering. As far as I'm concerned, pdf.js is one of those increasingly-common cases where Mozilla has unilaterally decided that it knows Just What I Need, and followed up by attempting to impose it without offering me a choice.

Post reply on HN