wood burning stoves 2.0*
The moose likes JSP and the fly likes PDF generation usubg iText sending to  JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "PDF generation usubg iText sending to  JSP" Watch "PDF generation usubg iText sending to  JSP" New topic
Author

PDF generation usubg iText sending to JSP

Yzut Lo
Greenhorn

Joined: Sep 17, 2008
Posts: 2
Hello everyone,

so basically I have created the PDF from iText
now I need it send it to the UI (jsp page)
What is the best way to do this?

Thank you,
<newbie>
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41073
    
  43
You could store the file in a publicly accessible directory on the server, and then provide a link to it.

You can also stream the PDF to the client, but that's not going to work from a JSP, only from a servlet (which is where you should be doing any PDF generation anyway).


Ping & DNS - my free Android networking tools app
Yzut Lo
Greenhorn

Joined: Sep 17, 2008
Posts: 2
Originally posted by Ulf Dittmer:
You could store the file in a publicly accessible directory on the server, and then provide a link to it.

You can also stream the PDF to the client, but that's not going to work from a JSP, only from a servlet (which is where you should be doing any PDF generation anyway).



well as I have it now I have a java class pdfgen (creates the pdf).
and another class tha calls this pdfgen class that extends org.springframework.web.servlet.mvc.SimpleFormController
Then I have a servlet.xml using spring to map everything together.
In theory the web.xml will help me link the jsp page to the SimpleFormController..
Is this a bad approach? is my understanding correct about the technologies involved?

Many thanks,
<newbie>
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: PDF generation usubg iText sending to JSP
 
Similar Threads
Question for Marty Hall : pdf output from servlet ?
jsp to pdf
Can I read already pdf file
How can i generate PDF from JSF
Download the Web page as a PDF and Image from the web site itself