This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Groovy and the fly likes feeding byte[] to crreate a pdf Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Languages » Groovy
Bookmark "feeding byte[] to crreate a pdf" Watch "feeding byte[] to crreate a pdf" New topic
Author

feeding byte[] to crreate a pdf

liliya woland
Ranch Hand

Joined: Apr 11, 2006
Posts: 134
Hello,
did anybody try using grails pdf plugin? I need to create a pdf from a byte[] and I found this plugin. I'm not sure if this plugin is appropriate for the task. Any on the topic will be much appreciated. Thank you.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

What plugin? Do you have a link?


GenRocket - Experts at Building Test Data
liliya woland
Ranch Hand

Joined: Apr 11, 2006
Posts: 134
I got the plugin by running this command:grails install-plugin pdf 0.6

I gave up the idea of using the plugin, it is good for opening already on a disk files, pdfs anf gsp. But I have a byte[], so I'm using now iText instead. I got the functionality of viewing a pdf ready, but still struggling with getting my byte[] into it.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Did you know that most plugins are documented on the Grails web site? They have a plugin portal where you can search for plugins and read all about them.

http://www.grails.org/plugin/home
liliya woland
Ranch Hand

Joined: Apr 11, 2006
Posts: 134
I looked through the demos of that plugin. I'm attempting to feed my byte[] into a PdfWriter at the moment.
liliya woland
Ranch Hand

Joined: Apr 11, 2006
Posts: 134
Here is my solution. It's bare bones, but it works:
Susan Sims
Greenhorn

Joined: Dec 26, 2010
Posts: 2
FWIW, Qoppa Software delivers Java libraries to do most functions with PDF files. Code samples and demos of each of the libraries are readily available, so you can quickly decide if an individual library might help you.
liliya woland
Ranch Hand

Joined: Apr 11, 2006
Posts: 134
Thank you, I'll keep it in mind, although the tools didn't look like open source libs. I worked with iText on several projects, years apart, and I have to say, this time around the only issues we had was figuring out where to keep the lib for groovy projects. Locally I store it in Groovy/lib folder and all calls work like magic, but once we moved my code out to Amazon server, we a had hard time deciding where to keep them - the jar iText file. Import statements for "import com.lowagie...." were failing, someone else figured out that "import com.itext...." or something like "import com.pdfitext...." would work instead. So we took that direction for import calls, then the only lib that didn't compile was the Font lib, not sure why, but the simplest thing at that point was to get rid of the references to that particular lib. Very strange, but I'd still recommend iText
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: feeding byte[] to crreate a pdf