It's not a secret anymore!*
The moose likes JSF and the fly likes How can i generate PDF from JSF Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "How can i generate PDF from JSF" Watch "How can i generate PDF from JSF" New topic
Author

How can i generate PDF from JSF

Aiswarya Geidth
Greenhorn

Joined: Jan 10, 2012
Posts: 13
Hi

I am new to JSF. I want to generate PDF from JSF. I have data in h:dataTable in JSF and i want to add this data to the PDF Document table.
Please can any one help me.



Thanks in advance
Rok Koncina
Greenhorn

Joined: Nov 30, 2011
Posts: 5
Take a look at itext.
Aiswarya Geidth
Greenhorn

Joined: Jan 10, 2012
Posts: 13
Thanks for response.

I was seen that iText and i am able to implement that one in SERVLET and in JSP but not in JSF.
So, i want to generate PDF on fly in JSF when clicking on a link.


Thanks
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
For tabular data I'd check out DisplayTag: http://www.displaytag.org/
Rok Koncina
Greenhorn

Joined: Nov 30, 2011
Posts: 5
Sorry, I gave you a fast answer that wasn't complete.
With Jboss Seam you can create a pdf in the similar way you create classic jsf page.
http://docs.jboss.com/seam/latest/reference/en-US/html/itext.html

You can fill this "page" with data the same way you fill the displayed jsf page. Than all you need is a link to this page and you'll get a pdf.
Aiswarya Geidth
Greenhorn

Joined: Jan 10, 2012
Posts: 13
Thanks for the solutions.

I got solution for my problem. In normal java bean i used response.setHeader using FacesContext.



Thanks
 
jQuery in Action, 2nd edition
 
subject: How can i generate PDF from JSF