Skip to content
hiteshBhatia edited this page Sep 26, 2010 · 8 revisions

Grails Google PDF Viewer Demo

This plugin integrates power of Google doc pdf viewer to your application , though this plugin has been created using Grails-1.3.4 but it supports all version from Grails-1.1.

Example - Whenever pdf is attached as attachment to gmail , it gives two options

  1. download
  2. View When user selects view is opens pdf in GoogleDoc , similar effect is provided by this plugin , all user needs to do is give full path to tag provided by taglib.

Advantage

  • With this plugin end user will be able to read/print pdf, even if pdf reader is not installed on his machine/browser.
  • For application security pdf link is expired after first hit from Google.( If opened in Chrome mode link does not expire)

##Installation

Usage

  • To use this plugin , user needs to use isSupportedByGoogleDocs tag of PdfTaglib , which checks whether doc is supported by Google Doc and if its supported a link is created to Google Docs.
  <pdf:isSupportedByGoogleDocs params="['fullPath':fullPath,chrome:true]">
         View on Google Docs
  </pdf:isSupportedByGoogleDocs>
  • Here fullPath is full path of file along its name . ex /home/username/pdfname.pdf
  • param chrome is optional here. if opened in chrome mode , i.e chrome:true , then Pdf is opened with Menu.
  • Make sure that action viewPdf of controller pdfViewer pubic.
  • Since google needs to hit your application , will not work on local machines.

##Test For local machine

IMPORTANT: Action viewPdf of controller PdfViewer must be public, so that google can access it.

####For any queries and suggestions mail us at

Clone this wiki locally