1

The title is a little confusing. I'll elaborate.

As far as I can tell, the Google Docs Viewer tool accepts a link to a raw document file (e.g. .doc, .pdf, et. al.), and renders its contents in the browser. For example, this url to a pdf http://research.google.com/archive/bigtable-osdi06.pdf when passed to Viewer, returns this link: http://docs.google.com/viewer?url=http%3A%2F%2Fresearch.google.com%2Farchive%2Fbigtable-osdi06.pdf

What I'm trying to achieve is, use the Viewer to view a document already hosted in Google Docs (i.e. no longer a raw document file). When passing a link to a Google Docs document to the Viewer, the result is not as expected. It renders the link's HTML source instead of the document's contents.

The reason I want to do this is that I want to be able to use the "embed" feature of Viewer to view Google Docs documents. Does Google Docs have a "link to embeddable view" feature?

P.S. Here is a sample snippet to an embedded document. This is what I want, but pointing to an existing Google Docs document.

<iframe src="http://docs.google.com/viewer?url=http%3A%2F%2Fresearch.google.com%2Farchive%2Fbigtable-osdi06.pdf&embedded=true" width="600" height="780" style="border: none;"></iframe>
0

1 Answer 1

0

Maybe I've found a workaround.

Firstly be sure to have set the document sharing to anyone with the link.

Then, in the list view of Google Docs/Drive, select your document and click More > Download... and choose whatever format you want (e.g. PDF). The URL that appears for a second when you finally click Download is the URL you need (the one that works with Google Viewer).

For text documents you can get the same URL by taking the document editing URL, e.g.:

https://docs.google.com/document/d/ [alphanumeric code] /edit

And change it like that:

https://docs.google.com/document/d/ [alphanumeric code] /export?format=pdf

For other document types it's a bit different. Presentation:

https://docs.google.com/presentation/d/ [alphanumeric code] /edit
https://docs.google.com/presentation/d/ [alphanumeric code] /export/pdf

Spreadsheet:

https://docs.google.com/spreadsheet/ccc?key= [alphanumeric code] 
https://docs.google.com/spreadsheet/fm?key= [alphanumeric code] &fmcmd=12

I don't have tried with uploaded files or other formats, but hope it helps.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .