You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Di Perna Francesco <fd...@documentsolutions.it> on 2001/05/24 16:30:11 UTC

Using FOP in java Programm

Hello.
I am beginner in FOP (just few days),
I have used FOP using the class org.apache.fop.apps.Fop by command line.
I saw this class  use the "Driver" class.
Can you have some example of java code for create PDF from a DOM Document 
(one document for xml and one for xsl).
Thanks




******************************************************************************* 

Di Perna Francesco tel. +39-050-970302
Document Solutions s.r.l fax. +39-050-543063
http://www.documentsolutions.it e-mail: fdiperna@documentsolutions.it
Document Solutions is an Adobe Authorized Training Centre

"There is nothing so powerful as an idea whose time has come"
  Victor Hugo
******************************************************************************* 


Re: Using FOP in java Programm

Posted by Keiron Liddle <ke...@aftexsw.com>.
On Thu, 24 May 2001 16:30:11 Di Perna Francesco wrote:
> Hello.
> I am beginner in FOP (just few days),
> I have used FOP using the class org.apache.fop.apps.Fop by command line.
> I saw this class  use the "Driver" class.
> Can you have some example of java code for create PDF from a DOM Document
> 
> (one document for xml and one for xsl).


If you look in the cvs file
src/org/apache/fop/tools/TestConverter.java

it (for testing purposes) takes an xml and an xsl file and creates the
output (which can either be an xml of the area tree or a pdf).



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Re: Using FOP in java Programm

Posted by Weiqi Gao <we...@networkusa.net>.
On 24 May 2001 17:23:59 +0100, Alex McLintock wrote:
> 
> --- Di Perna Francesco <fd...@documentsolutions.it> wrote:
> > 
> > Hello.
> > I am beginner in FOP (just few days),
> > I have used FOP using the class org.apache.fop.apps.Fop by command line.
> > I saw this class  use the "Driver" class.
> > Can you have some example of java code for create PDF from a DOM Document 
> > (one document for xml and one for xsl).
> 
> Er, can anyone confirm that this works? 
> Running FOP on a DOM tree broke ages ago and ever since then I've been 
> using an XMLSerializer and a SAX parser on the resultant string.
> 
> The XSL stage is up to you to figure out really - you end up with XML at the end
> so it is pretty much the same as before.

Here's some throw away code I wrote earlier to test the speed of various
tools needed for doing (XML + XSLT -> FO -> PDF).

FOP.java, TrAXFOPSAX.java, TrAXFOPDOM.java, and TrAXFOPStream.java shows
how to use Driver from inside a Java application.

(The foo.xml and foo.xslt are the periodic table and associated style
sheet from Charpter 14 and Chapter 15 of XML Bible that's mentioned in
the resources section of FOP documentation.)

-- 
Weiqi Gao
weiqigao@networkusa.net

Re: Using FOP in java Programm

Posted by Alex McLintock <al...@yahoo.com>.
--- Di Perna Francesco <fd...@documentsolutions.it> wrote: > Hello.
> I am beginner in FOP (just few days),
> I have used FOP using the class org.apache.fop.apps.Fop by command line.
> I saw this class  use the "Driver" class.
> Can you have some example of java code for create PDF from a DOM Document 
> (one document for xml and one for xsl).

Er, can anyone confirm that this works? 
Running FOP on a DOM tree broke ages ago and ever since then I've been 
using an XMLSerializer and a SAX parser on the resultant string.

----

The XSL stage is up to you to figure out really - you end up with XML at the end
so it is pretty much the same as before.

(Oh - and thanks to Arved for pointing out my CVS error earlier today 
- yes fop does build straight from CVS)


Alex


=====
Alex McLintock        alex@OWAL.co.uk
OpenWeb Analysts Ltd, http://www.OWAL.co.uk/ 
DR WHO COMPETITION: http://www.diversebooks.com/cgi-bin/caption/captions.cgi?date=200104
Get Your XML T-Shirt <t-shirt/> at http://www.inversity.co.uk/

____________________________________________________________
Do You Yahoo!?
Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
or your free @yahoo.ie address at http://mail.yahoo.ie

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org