DevOps Zone is brought to you in partnership with:

Kay Cichini (MSc, Biology), Nature Protection Expert, Tyrol/Austria. I'm author of theBioBucket-Blog, where I share examples for data management, data processing, statistical analysis and report generation using the R-Software. Kay is a DZone MVB and is not an employee of DZone and has posted 28 posts at DZone. You can read more from them at their website. View Full User Profile

Embedding Google Docs and Google Viewer

04.07.2013
| 10009 views |
  • submit to reddit

Here's a short example of the usage of the Google Viewer and Google Docs embeds (see here). If you want to embed a view of any file on Google Drive/Docs you can do this by putting a pdf preview (the file could be in any format, see first example, which is a Google text document) in an iframe or, in the case of spreadsheets, the speradsheet itself into an iframe. 

The second embed below shows the latest outcome of an online questionnaire and in the speradsheet that holds the result the new answers to the questoinnaire are updated every 5 minutes after refreshing the view. So, you can, i.e., make an online questoinnaire with a Google form and display the results like below. With a little tweaking of the parameters, which I obviously haven't done yet, the result would of course be more visually appealing. 

If you try for one of your files you just need to replace the id/key in the URL:

<iframe src="https://docs.google.com/viewer?url=https://docs.google.com/document/d/125CJmmlBfy7UgfYuBAmb1_HSCuyz8NV133361KTK1SE/export?format%3Dpdf&id=125CJmmlBfy7UgfYuBAmb1_HSCuyz8NV133361KTK1SE&embedded=true" style="width:680px; height:860px;" frameborder="0"></iframe>
 
<iframe src="https://docs.google.com/spreadsheet/pub?key=0AmwAunwURQNsdFplUTBZUTRLREtLUDhabGxBMHBRWmc&embedded=true" style="width:680px; height:300px;" frameborder="0"></iframe>

 
Published at DZone with permission of Kay Cichini, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)