An unofficial blog that watches Google's attempts to move your operating system online since 2005. Not affiliated with Google.

Send your tips to gostips@gmail.com.

January 3, 2009

Google Viewer for Gmail Attachments

Last month, I mentioned that Gmail links to a new viewer for PDF attachments, powered by Google Docs. It turns out that Google's viewer doesn't work only for PDF files and Google intends to replace the outdated "view as HTML" option with a proper application.

Right now, you can use Google Viewer for PDF, DOC and PPT attachments, but the option is enabled by default only for PDF files. Here's to open Word documents and PowerPoint presentations in Google Viewer:

1. Find an email that includes a DOC or PPT attachment, for example by searching for [has:attachment filename:doc OR filename:ppt].

2. Click on "view as HTML" next to the attachement:


3. Edit the URL by replacing view=att with view=gvatt.


4. Open the page.


You'll be redirected to a page that has the following address:
http://docs.google.com/gview?attid=0.X&thid=THREADID&a=v
(X is the number of the attachment, while THREADID is a value that identifies a Gmail thread).

Google Viewer automatically generates images for each page of your document, you can zoom in/out, there's a basic search feature and you can select text.

Why would you choose this instead of opening the attachment in Google Docs? It loads faster, the document doesn't clutter your Google Docs dashboard and it looks much better. The viewer doesn't inherit any limitation from Google Docs: it includes pagination and it uses the original fonts and layout settings.

24 comments:

  1. I have the option for e mail attachments to "open as a Google Document" instead of needing to edit the URL as you suggest. The end result is formatted the same as well.Cheers

    ReplyDelete
  2. "Open as a Google Document" is a different option that opens the document in Google Docs and it allows you to edit the file and share it. This post is about an option that only lets you view a document.

    ReplyDelete
  3. Is there a way - via some sort of hack - to have this set permanently? editing an address will drive me bonkers!

    ReplyDelete
  4. I hope that it will soon avaliable for documents on the web. =D

    ReplyDelete
  5. Hmmm, now to see how long it takes before someone Greasemonkeys it. :)

    ReplyDelete
  6. I hope that it will soon become avaliable for Gmail mobile app users.

    ReplyDelete
  7. Ah, yes. I'm thinking Greasemonket as well. Let us know when someone does this.

    ReplyDelete
  8. I wrote a basic script that automatizes the process, but I don't think it's the right way. Greasemonkey scripts run only after the page loads, so you'll first see the basic HTML conversion and then you'll be redirected to the viewer. Another problem is that the script is not limited to DOC and PPT files.

    // ==UserScript==
    // @name Google Viewer for Gmail attachments
    // @namespace http://googlesystem.blogspot.com/
    // @include http://mail.google.com/mail/?*&view=att&*&disp=vah&*
    // @include https://mail.google.com/mail/?*&view=att&*&disp=vah&*
    // ==/UserScript==
    var loc=document.location+"";
    loc=loc.replace(/&view=att&/, "&view=gvatt&");
    document.location=loc;

    ReplyDelete
  9. indeed this would be great for gmail mobile!

    Cheers

    ReplyDelete
  10. Anyway, just adding gv to view=att takes no time and can be done by everybody. Good trick, thank's Alex.

    ReplyDelete
  11. oh,I am so sorry to find that it can't support chinese.

    ReplyDelete
  12. Very nice trick Alex. It works quite well. I get all my documents in front of my screen in a moment.

    ReplyDelete
  13. Turns out it also works for OpenDocument files (odt, ods, etc.). To do it for an odt, simply get the url from the link "Open as a Google Document" and change the "view=wtatt" to "view=gvatt."
    I would expect that this actually works for any file format that can be imported into Google Docs. Very nice!

    ReplyDelete
  14. >I wrote a basic script that automatizes the process, but I don't think it's the right way. Greasemonkey scripts run only after the page loads, so you'll first see the basic HTML conversion and then you'll be redirected to the viewer.

    isn't there a Greasemonkey-supported (sorta) API for Gmail now so that the links could be edited in-place on the message view? that's probably the best place to do it... better yet, adding an additional link that says "view in google viewer"

    and extending this idea, it would be kinda nice to be able to click directly to the HTML view for PDFs in some cases, like where text rendering speed really matters but accuracy doesn't.

    ReplyDelete
  15. I'm looking forward to seeing this become the default attachment handler in Gmail. :)

    ReplyDelete
  16. I like the functionality with this new viewer and hope it gets implemented soon for various file types.

    My enhancement requests for it are:

    1) Better Search - it only highlights found text, but doesn't take you to it. It needs arrows or next/previous buttons to jump to ('go') to the found text.

    2) Page up/down keys should take you to previous/next page, not just jump a few lines at a time.

    3) Option to minimize/hide the right-side control panel so the pages can be viewed at full screen width.

    4) Option to save file as Google Doc.

    These changes would make a good start to 2009!

    ReplyDelete
  17. Done by ManuJ : http://userscripts.org/scripts/show/39872 !
    Thanks to him !

    ReplyDelete
  18. I love the listen button when i receive an audio file in an email! Its so smart to open attachements in the browser and a flash-player plays the audio. wow!

    ReplyDelete
  19. attachment handling has certainly improved big time in recent gmail updates, makes life easier every day!

    ReplyDelete
  20. What frustrates me, is that I have my Gmail open in SSL, i.e. https://mail.google.com, but it redirects to http://docs.google.com !

    Is that supposed to be secure?

    ReplyDelete
  21. I found this greasemonkey script that does what you're talking about:

    http://userscripts.org/scripts/show/39872

    I just tested it briefly - seems like when you click on View as Html it will try to bring it up in google viewer first and if that doesn't work will bring it up in html.

    ReplyDelete
  22. Doesn't work anymore... too bad.

    ReplyDelete
  23. i have gmail mobile app so please I hope that it will soon become avaliable for Gmail mobile app users.it request for you google....

    ReplyDelete
  24. Why can Googlemail not open pdfs transmitted by Eudora from a Mac

    ReplyDelete