File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes XML and Related Technologies and the fly likes Newbie FOP question urgent plz? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Newbie FOP question urgent plz?" Watch "Newbie FOP question urgent plz?" New topic

Newbie FOP question urgent plz?

Gul Khan
Ranch Hand

Joined: Sep 03, 2003
Posts: 173
i have to generate a PDF report from an xml file "data.xml" and using FOP. now all i know is that there has to be a formating object xml file to be used by FOP. My question is how to generate FO file from data.xml everytime user asks for a report. If its using XSL how would i run that XSL file to generate the that XML and make it an input for the FOP.
Please guide me through the entire process on how to generate the required pdf from the xml file each time asked..
Thanks alot for any help
Balaji Loganathan
author and deputy

Joined: Jul 13, 2001
Posts: 3150
The simple answer is to use FO Processor like Apache FOP.
Check the servlet example after downloading the package,It takes XML and XSL as input and produces FO on the fly(in memory) and output the PDF stream. => FOP Site.

Spritle Software Blogs
Lasse Koskela

Joined: Jan 23, 2002
Posts: 11962
Here's a more specific link to the FOP website:
Note that it's you who needs to write "foo-xml2fo.xsl" referred to in that example. For that purpose, you need to learn the XSL-FO schema (this page could help you with that).

Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
I agree. Here's the link:
subject: Newbie FOP question urgent plz?
It's not a secret anymore!