Grails Pdf Viewer Plugin

14 / Oct / 2010 by Hitesh Bhatia 3 comments

In one of our recent Grails project we had to provide support for Viewing Pdf even if end user’s browser did not have any pdf viewer plugin or add on installed. So we decided that we would open our pdf on Google Doc’s pdf viewer.

This will behave in same manner as Gmail does , when it has a pdf as attachment to mail , It provides two buttons
1. View
2.Download
Now if user selects view , the pdf viewer opens in Google Doc.

We implemented this in our project and I extracted code from it to create a plugin (pdf viewer).

Installation of plugin

grails install-plugin pdf-viewer

Usage


       View on Google Docs

Here fullPath is full path of file along its name . ex /home/username/pdfname.pdf . And Pdf is a taglib included in this plugin.

Detailed documentation of plugin can be found at GitHub

Demo App for this plugin can be found at Github

_________________________________
Hitesh Bhatia
Mail
LinkedIn,Facebook,Twitter
_________________________________

FOUND THIS USEFUL? SHARE IT

comments (3)

Leave a Reply

Your email address will not be published. Required fields are marked *