aspose file tools*
The moose likes XML and Related Technologies and the fly likes PDF Creation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "PDF Creation" Watch "PDF Creation" New topic
Author

PDF Creation

Arun Kumar
Ranch Hand

Joined: Jan 21, 2005
Posts: 129

We have a requirement of creating PDF documents dynamically

I am little bit confused here,Is XSL-FO a good choice to do so,I am not getting good results from google,I am new to XSL-FO but have good experience with XML

Or is iText the ideal choice
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39547
    
  27
That depends a lot on what kind of data you have. If the data is in XML format, and very regular -e.g. tabular-, then XSL-FO might be a good choice. The iText API uses a more programmatic (as opposed to FOP's declarative approach) to creating PDFs. It's appropriate for creating files that are irregular in nature, meaning they combine different kinds of data.


Ping & DNS - updated with new look and Ping home screen widget
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12675
    
    5
I did an application for a client using XSL-FO. The starting data was fairly complex so I did a DOM based extraction from the base data into a form closer to the desired output sequence. The XSL-FO community has an active user base and responds quickly to questions.

I found Holman's book "Definitie XSL-FO" to be a big help.

Bill


Java Resources at www.wbrogden.com
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2476
    
    7

Is XSL-FO a good choice to do so
I think yes.
Apache FOP is good quality, and the XSL:FO format is well documented.

Regards, Jan


OCUP UML fundamental and ITIL foundation
youtube channel
Dilshan Edirisuriya
Ranch Hand

Joined: Apr 22, 2006
Posts: 299
Actually I worked with XSL-FO recently. I created the pdf using Apache FOP library. I did a xsl transformation with xml and created a FO. Then I passed that FO to Apache FOP. But I found that FO generation takes considerable amoun t of time to process. I had to process 40-100 MB xml files. I tried that with another commercial FO parser called XML Mill(Trial). But it was same as FOP. It took a lot of time process.
To overcome that I used a XML DOM parser and filtered the relavant data and then passed to iText library. Actually it was a good option. It takes less time to process.
So I prefer the 2nd approach. Any different ideas. Can anyone suggest an optimization strategy to convert FO to pdf in less time consuming manner.


Dilshan Edirisuriya SCJP1.4, SCWCD1.4, SCBCD 5
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2476
    
    7

Originally posted by Dilshan Edirisuriya:
... I created the pdf using Apache FOP library. I did a xsl transformation with xml and created a FO. Then I passed that FO to Apache FOP. But I found that FO generation takes considerable amoun t of time to process.
Did you take the time to report your experience to the fop user comunity or to the fop team? If you can show them your issues, they might be able to help you, and your findings might help to improve the product.

Rgards, Jan
Dilshan Edirisuriya
Ranch Hand

Joined: Apr 22, 2006
Posts: 299
Did you take the time to report your experience to the fop user comunity or to the fop team?


I didnt. Actually I wasnt able to intercept the pdf generation. Thet means I logged the time for both FO generation and pdf generation because I passed my FO to pdf generator at runtime.

I think I choose the wrong path. To process such a huge file you dont need to go through the FO generation. To process small data it will be a good solution.
Any ideas?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: PDF Creation
 
Similar Threads
rendering a xsl fo file to html and pdf
KISS or KILL?
Visual Editor for XSL-FO
[Struts Recipes] PDF Recipe
[XSL/FO] displaying date in pdf file