Google viewer is an online tool from google enable you to embedding your document file like .doc,.pdf,.xls,etc into your web pages so users can directly see your document in the web without downloading it first.

This tutorial will guide you how to embed your pdf file into web page. To use google viewer, you must insert the following iframe into your web page:

[sourcecode lang=”html”]
<iframe src="http://docs.google.com/viewer?
url=URL_FILE_PDF&amp;embedded=true"/>
[/sourcecode]

The google viewer url comes with two arguments:

  1. [cci]URL[/cci]: your pdf file url, must be reachable by internet, not in your localhost
  2. [cci]embedded[/cci] : (true/false) embed or no

Here an example:

[sourcecode lang=”html”]
<iframe src="http://docs.google.com/viewer?
url=http://semurjengkol.com/wp-content/uploads/2011/08/
911.pdf&amp;embedded=true" width="800" height="400"/>
[/sourcecode]

Here the result of above code:


0 Comments

Leave a Reply

Avatar placeholder