This is an old revision of the document!
Table of Contents
Google Docs Viewer Plugin
Compatible with DokuWiki
No compatibility info given!
This extension has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues.
Installation
This plugin uses and depends on Google's Service. Please check and see first the Google Docs Viewer Terms of Service.
By using this service you acknowledge that you have read and agreed to the Google Docs Viewer Terms of Service. — Google Docs Viewer - Additional Terms of Service
Install the plugin using the Plugin Manager and the download URL above, which points to latest version of the plugin. Refer to Plugins on how to install plugins manually.
Examples/Usage
Show a given online document such as PDF documents or PowerPoint presentations in your DokuWiki page using Google Docs Viewer service. Please refer to Google site to know detail on supported file types.
Let's suppose you have a link (with small fileicon) to given online document in your page source:
{{http://example.com/path/to/document.pdf}}
To show the document in the embedded viewer, markup it with {{gview>
and }}
as follows:
{{gview>{{http://example.com/path/to/document.pdf}}}}
You do not need to remove {{
and }}
around document URL; When you decide to stop embedding in future, it is enough to delete only gview markup. However you may remove inner {{
and }}
to embed the document.
A most simple example:
{{gview>http://example.com/path/to/document.pdf}}
Some more complex example:
{{gview> http://example.com/path/to/document.pdf 50%,200px}} {{gview> http://example.com/path/to/document.pdf 400px}} {{gview> {{http://example.com/path/to/document.pdf|title}} noreference }}
Note
- The document to view must be “public to the world”.
- The DW page must be reachable from the internet (because Google's servers are used).
Limitation
- Unfortunatly, the Google Docs Viewer service seems not accept ugly url like:
http://example.com/lib/exe/fetch.php?media=document.pdf - You need to make effective URL rewrite in your web server to embed a document stored in your DW media directory.
Syntax
{{gview> url [size] [noembedded] [noreference] }}
- url : Full URL of the online document to view, must starts with “http:” or “https:”.
- This means you may embed a document published at different web site. The source url (reference) acknowleged above the viewer frame.
- size : Size of embedded viewer.
- Default value is
100%,300px
, which means 100% width and 300px height. - When one value is given it is assumed to be the height.
- noembedded (or noembed)
- Indicate to show only hyperlink to the viewer, instead of embedded viewer.
- Document title specified after “|” in
{{
and}}
is used as a link text.
- noreference
- Suppress a reference line just above embedded viewer frame. The reference is a hyperlink (url) to the online document shown in the viewer.
Configuration and Settings
There are no configuration options for this plugin.
CSS
The class tpl_gview is avilable for selector of html element. Border settings for embedded viewer found in style.css.
Language file
en, ja, de
Development
This is first trial to develop my own plugin.
Change Log
I have just started github.
- due update plugin.info (2014-11-16 02:49)
- PHP5 strict (2014-11-16 02:48)
- fix to show title if noembed specified (2014-11-16 02:43)
- Merge pull request #1 from ssahara/dev (2014-06-14 05:34)
- plugin info updates (2014-06-14 05:30)
- add lang files for config manager (2014-06-14 05:29)
- re-think linkId->url conversion (2014-06-11 16:56)
- clarify function visibility (2013-11-26 16:38)
ToDo
- consider URL rewrite to allow embedding media file in data/media directory in case of $conf['userewrite'] = 1; (rewrite ugly url: .../lib/exe/fetch.php?media=document.pdf → .../_media/document.pdf)
FAQ
[discussions should ideally be deleted and turned into FAQ entries along the way]
Discussion
Show PDF documents stored in DW media
Thanks for this plugin!
It would be great, to view pdf documents stored in DW media directory. Joe, 2013-03-20