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.

July 16, 2007

Download Published Documents and Spreadsheets

If someone sends you a read-only version of a Google document or spreadsheet and you want to download it as a PDF and link to that PDF from your site, there's an easy way to do it.

For spreadsheets

A published spreadsheet has an address that looks like this: http://spreadsheets.google.com/pub?key=[ID]. To get the address for a different format, you need to append &output=, followed by the extension of the format. For example, http://spreadsheets.google.com/pub?key=[ID]&output=xls for Microsoft Excel spreadsheets. Other valid output formats: pdf, ods (for OpenOffice spreadsheets), csv, txt.

Update (October 2010): In the new version of Google Spreadsheets, the URL is: http://spreadsheets.google.com/ccc?key=[ID]&output=xls.

For documents

Published documents have a similar URL: http://docs.google.com/View?docid=[ID]. To obtain the address for another format, you'll have to use the docid parameter:
http://docs.google.com/MiscCommands?command=saveasdoc&
exportformat=[FORMAT]&docID=[ID]
, where [FORMAT] can have one of these values: pdf, doc, oo (for OpenOffice documents), rtf, txt.

Update (October 2010): In the new version of Google Docs, the URL is: http://docs.google.com/document/export?format=[FORMAT]&id=[ID].

Another way to download the files is to go to Google Docs homepage and open the files from there, but, at least for spreadsheets, the method described above lets you actually link to the file in a different format and people that click on the link don't need to have a Google account. For documents, a visitor of your site has to log in to his/her Google account before clicking on the link.

{ From an idea of DPic. }

15 comments:

  1. Open Word, File=>Open, Type URL and Enter.

    Your document is open !

    ReplyDelete
  2. This also works nicely with OpenOffice.org. Use the file type ods (for spreadsheets) or odf (for text documents).

    If you use "&output=..." and want a working copy save the file locally with a new name

    K<o>

    ReplyDelete
  3. Do you have any hints on how to make the download work when you are within Firefox? Google Docs doesn't allow it to work for some reason.

    ReplyDelete
  4. Perfect
    Just what I needed :D

    To let everyone download it, select your file and click 'Share'. Then 'See who has access'. Change the text at the bottom to 'People can view this item without signing in.'

    hope it helps :)

    ReplyDelete
  5. Doesn't work with the new docs format: For example

    https://docs.google.com/document/edit?id=1rwySexqHZZIES0CVAo_HTJ49fPjvuuuS_HC4P0SJJpY

    Any suggestion?

    ReplyDelete
  6. For the new version of google docs, I got the link from the green urls in the Download list of google chrome:

    https://docs.google.com/document/export?format=[FORMAT]&id=[ID]

    ReplyDelete
  7. Is there an updated version for spreadsheets?

    ReplyDelete
  8. @Danny:

    I've update the post with the new URLs. You can now export documents and spreadsheets from the File menu.

    ReplyDelete
  9. still deosn't work - new(er) version of google docs has an even more obfuscated url

    https://docs.google.com/viewer?a=v&pid=sites&srcid=ZGVmYXVsdGRvbWFpbnxraGFyaXp6bWF0aWt8Z3g6NjJiZTVlNjJjNWYxNzE2MQ

    ReplyDelete
  10. For direct downloading of PDF, use this syntax.

    http://docs.google.com/uc?export=download&id=[ID]

    ReplyDelete
  11. http://docs.google.com/uc?export=download&id=[ID]

    is working. Thanks!

    ReplyDelete
  12. That doesn't work for spreadsheets anymore. Changing the output to "xls" is rejected.

    ReplyDelete
    Replies
    1. Just curious if anyone knows the proper url at this time to download the .xls spreadsheet?

      Delete