Skip to content
This repository


hiteshBhatia edited this page · 8 revisions

Pages 1

Clone this wiki locally

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.


  • 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 token given to Google expires after first hit.( If opened in Chrome mode token does not expire)



  • 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
  • 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

Something went wrong with that request. Please try again.