Over a million developers have joined DZone.
Platinum Partner

Embedding Google Docs and Google Viewer

· DevOps Zone

The DevOps Zone is brought to you in partnership with New Relic. Improving the performance of your app is easy with New Relic's SaaS-based monitoring.

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>


The DevOps Zone is brought to you in partnership with New Relic. Know exactly where and when bottlenecks are occurring within your application frameworks with New Relic APM.


Published at DZone with permission of Kay Cichini , DZone MVB .

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}