File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

creating pdf,xml,doc file using servlet

 
faisal ishaque
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My question is that, in my application there is some data which can be converted into pdf,xml and doc format?
What do you reccomend that either i use xsl/xslt and xsl-fo or use third party tools for converting the data into desire format?and could i use crystal report for this purpose?
Please give me the best practices for generating different format files for client using jsp/servlets
thanks and best regards.
Faisal Ishaque
 
Mark Spritzler
ranger
Sheriff
Posts: 17276
6
IntelliJ IDE Mac Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. If you want PDF's and they aren't difficult reports, I'd check out IText for creating them. It has Java Classes for creating PDFs. If you want to transform your XML into HTML, use XSLT. I don't know much about Crystal Reports class, but We use Crystal with our VB applications and it is handy.
Mark
 
faisal ishaque
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for giving me the helpfull suggestions...
Also tell me the performance issues using xsl/xslt/xsl-fo and third part tools?
 
Mark Spritzler
ranger
Sheriff
Posts: 17276
6
IntelliJ IDE Mac Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's a good question. Performance seemed adequate in the couple of stuff that I have done. It is as usual, internet time.
Mark
 
Sean Sullivan
Ranch Hand
Posts: 427
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dynamically Creating PDFs in a Web Application
http://www.onjava.com/pub/a/onjava/2003/06/18/dynamic_files.html
iText (Java PDF library)
http://www.lowagie.com/iText/
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you use a cache to store pre-compiled XSL documents performance decrease is negligable (especially seen in the light of the typical runtime of a medium sized JSP or servlet, throw in some EJB calls and you will never even notice) after the first request that adds the compiled XSL to the cache.
I've successfully used code like the following (this is a rough draft of a version I'm working for for an upcoming new project):

as the doPost method of a servlet. 'cache' is a simple HashMap that's declared static to the servlet.
Calling entities pass a Document object and the name of an XSL stylesheet (which are assumed to be stored in /WEB-INF/xsl here).
Using similar code written for an earlier version of Xalan I clocked transformation times of 2-5 milliseconds for quite complex XSL stylesheets (with compilation taking 300 or so milliseconds, illustrating the need for caching).
About half this code is actually concerned with errorchecking, using an HTML template to generate an HTML output to display errors on the fly.
[ December 01, 2003: Message edited by: Jeroen Wenting ]
 
Anonymous
Ranch Hand
Posts: 18944
  • 0
  • send pies
  • Quote
  • Report post to moderator
Hi faisal,
if you want to include the Model-View-Controller pattern in your application design check out StrutsCX to generate your XML or PDF output. StrutsCX is an extension to the Apache Struts framework for use with XSLT - as alternative to JSP. It includes Apache's FOP.
http://it.cappuccinonet.com/strutscx
Regards,
Bernhard Woehrlin
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic