October 14, 2009

Use Google's Document Viewer to Read PDF Files Online

Google Docs Viewer is a handy way to view PDF, PPT and TIFF files online, without having to install plug-ins or additional applications. Unfortunately, Google didn't make it easy to use the viewer without having to manually generate URLs.

A Greasemonkey script automates the process by replacing all the links to PDF, PPT and TIFF files from a page with links to Google's document viewer. To use the script, you need to install Greasemonkey in Firefox or use a dev build of Google Chrome. It should also work in Opera, Safari + GreaseKit and Internet Explorer + IE7Pro.


Hopefully, the future versions of Firefox, Chrome and other browsers will allow users to associate content types with web services, so that you can open KML files in Google Maps, iCal files in Google Calendar or Microsoft Office files in Google Docs.

10 comments:

  1. I've used the PDF viewer several times. It works fine, but images in PDF tend to be displayed at reduced quality compared to the same PDF downloaded and viewed as locally. This seems to be because the Google Document Viewer displays each PDF page as an image, and this is slightly more lossy than the original images in the PDF. Otherwise, a neat feature.

    ReplyDelete
  2. Here it is as a bookmarklet!!

    http://www.marklets.com/Bookmarklets/Open+PDF+PPT+TIF+urls+with+Google+docs+Viewer.aspx

    ReplyDelete
  3. This would be even better if it changed the links' onclick events to open the PDF viewer, and left the actual hrefs unchanged. That way, you could still copy/paste the URL of the PDF from the link if you wanted.

    ReplyDelete
  4. Note there seems to be an issue with the embedded version of the Google PDF Viewer when used in IE8. There is apparently a cookie problem that can only be solved by first invoking www.google.com , then the website with the embedded viewer.

    Google Docs earlier showed the same problem with IE8 when documentes would be shared fore vieweing or editing without the need to sign in...

    ReplyDelete
  5. What I'd really like is the ability to save any PDF to my Google Docs.

    ReplyDelete
  6. Regarding your last paragraph: crbug.com/11359 -- we'd like to see it happen too. Patches welcome!

    ReplyDelete
  7. Adam: As requested, I wrote an event driven version for you based on the original: http://userscripts.org/scripts/show/59870

    Also, if you'd like a bookmarklet for it: http://chibu.net/bookmarklets.html

    ReplyDelete
  8. For FF users, I'd instead recommend:
    https://addons.mozilla.org/en-US/firefox/addon/5363

    View and edit PDF files for free in your browser. A lot more features than Google's offering.

    ReplyDelete
  9. doesn't work with noscript enabled...

    ReplyDelete
  10. Having problems with it under Mac OS X, Firefox 4 rc 1. I get a broken link icon :-/

    ReplyDelete

Note: Only a member of this blog may post a comment.