wood burning stoves 2.0*
The moose likes JSP and the fly likes Generate PDF Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Generate PDF" Watch "Generate PDF" New topic
Author

Generate PDF

Rekha Pande
Ranch Hand

Joined: Jan 29, 2004
Posts: 145
hi..
I have this jsp page which i want to send as an attachment in PDF format .. is that possible....

What i want to do is that when i click on a button i want the jsp page that is displayed to be converted into pdf and then send it as an attachment through email or save that attachment on the hard disk.

Is this possible???... please can some one help me out on this one.. and please do give some code also...

Any help would be appreciated quite a lot

Thank you
Karl Laird
Ranch Hand

Joined: Jul 14, 2001
Posts: 67
If you can have your output page in well formed xHTML (rather than straight HTML) then using something like cocoon with FOP is probably one of your best bets (especially if you're already using Tomcat?).

Check out the links below:
http://cocoon.apache.org/2.1/howto/howto-html-pdf-publishing.html
http://xml.apache.org/fop/


The Eagle sneers at the Peacock<p>Systems Administrator<br />OrderWare Solutions Ltd<br /><a href="http://www.orderware.net" target="_blank" rel="nofollow">http://www.orderware.net</a>
bart zagers
Ranch Hand

Joined: Feb 05, 2003
Posts: 234
We use iText to generate simple pdf files of the different lists of our web applications.
Sudhir Meduri
Greenhorn

Joined: May 28, 2003
Posts: 22
Use apache FOP it's nice & cool

As mentioned in the previous post if u have xml or well formated html then that is so easy

XML--> XSL-FO--->PDF

once you have XSL-FO try to use it as a template in the jsp
meaning instead of html.
try change the content type to application/pdf and pass this XSL-FO jsp stream to FOP API's and u will get a PDF.

pls let us know how did it go


Thanks,<br />Sudhir <br />SCJP1.4
 
Don't get me started about those stupid light bulbs.
 
subject: Generate PDF
 
Similar Threads
I can't convert jsp pages to pdf why?
jsp email
Attachement in JSP
How to send mail with attachment
Export JSP to PDF format