Google's Javascript PDF Viewer is Embeddable
googlesystem.blogspot.com
googlesystem.blogspot.com
I really dont see anything new here. This is exactly the same stuff they have at Google books. Except now its in an iframe .
Flash implementations are obviously superior as of now.Also, try building a decent browser game in javascript and html5.
http://www.schillmania.com/arkanoid/
Note it does cheat and use flash for SFX
Does anyone know if firefox extensions can register as handlers for MIME types, or if they're restricted to diddling with chrome / pre-existing pages? It'd be really easy to write a WebKit plugin to do it, but not very useful since Safari ships with a flawless PDFKit-based viewer.
I want to get this working in Firefox, but NPAPI plugins are really gross. It looks doable that way, as it appears that a naked nsplugin still gets a DOM and everything, so I could just immediately set window.location.href and be done with it.
https://developer.mozilla.org/en/DOM/window.navigator.registerContentHandler
...except a website can only register themselves as a content-handler. You could probably hack up a bookmarklet to do it, if you can't find an XSS vector, but I can't seem to make it work myself.It'd be easy to make a greasemonkey-style extension that calls this on *, but it wouldn't work for links to other domains (which I'd bet are the majority of PDF links)
* Before version 8, Adobe's plugin was an epic piece of shit on all platforms
- old versions are on hundreds of millions of computers!
- it's still really crashy on Linux (especially in nspluginwrapper)
- The only OS X browser they support is Safari, in which it is unnecessary
* Google re-hosts the file for you
* It is ridiculously snappy with no main-thread-blocking initialization
* It will never crash your browser
* Your users don't have an ingrained hatred towards it
- Rebranding the free Acrobat as "Adobe Reader" was the stupidest thing
they've ever done (ever hear a user say 'my Adobe is broken'?)It's not text layed (laid?) out in a cool way with HTML.
It's a png image of each page of the pdf. It's quick sure, but images? Not text? It just seems wrong - why even make pdf's, if all you want is an image of the text?
For some PDFs, Google will give you the option to view it as HTML (it seems to just be the PDFs returned in search results?). It's usable for mostly-text documents, but that's about it.
The right way is to register application/pdf in the browser -- which you can only really do with a native-compiled NPAPI plugin. It looks like it is possible to package them inside a extension xpi, but I'm not sure if addons.mozilla.org will distribute such things.
https://addons.mozilla.org/en-US/firefox/addon/10737
You click a link and it first does some communicatin with Google Docs to get some kind of security token, so it takes 2-3 seconds for the new tab to come up.
EDIT:
A kickass version, just uploaded it to the Firefox Addons site:
The viewers for the first two formats are lagging in the UI department, it would be really nice to be able to access them online.
Does anybody know of similar project but that can be used in your own web app?
Someone explicitly added this feature, and I imagine that it will replace the lame "View as HTML" links on SERPs very soon. This ain't going away.
The real problem is that it's an empty-window UI -- it does nothing without Javascript on.
You might also be able to hack Thindoc in such a way that it worked for your purpose.
I use http://www.ajaxdocumentviewer.com/ on my own personal site. It works the same way as Google (but has ads), and handles .doc files.
I'd much rather use the Google app if it could handle .docs :(
- - - (select entire text and make into a link) - - -
javascript:(function(){dl=document.links;for(i=0;i<dl.length;++i){if(dl[i].href.substr(-4)==".pdf"){window.open("http://docs.google.com/gview?embedded=true&url="+dl[i].href);}}})()
- - -Userscript at: http://userscripts.org/scripts/show/57453
Tested on Minefield latest nightly, winxp, greasemonkey.
Edit: Fixed version available now.
javascript:(function(){dl=document.links;for(i=0;i<dl.length;++i){if(dl[i].href.substr(-4)==".pdf"){dl[i].href="http://docs.google.com/gview?embedded=true&url=+dl[i].href;}}})() javascript:dl=document.links;for(i=0;i<dl.length;++i){if(dl[i].href.substr(-4)==".pdf"){dl[i].href="http://docs.google.com/gview?embedded=true&url="+dl[i].href;}}void(0);