Grails Pdf Viewer Plugin
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
_________________________________
Hi Hitesh,
do you have any example for displaying a Pdf using Iframe in Grails?
Thanks,
– Ajit
updated and fixed ,
Thanks for information .
The links to GitHub are empty. Could you please fix them?