You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Michael König <Mi...@ms-koenig.de> on 2002/02/25 22:38:52 UTC

Options

Hello,
I create a DOM-Tree dynamically and put it together with a XSL-file to get a
PDF.

But now I have my own font information in the userconfig.xml and need to
bind it to my
workflow.

I gess I found a possibility to to so by using the setOption of a
PDFRenderer like this:
******************************************
Driver theDriver = new Driver();
Renderer theREnderer = new PDFRenderer();
theRenderer.setOptions( <use the userconfig.xml> );


theDriver.setRenderer(PDFRenderer() );
theDriver.setInputSource( new DocumentInputSource( getFormatedSource() ) );

theDriver.setOutputStream( getPDFOutputStream() );
theDriver.run();
********************************************

Now now I have a Question: Is this the right way and, if so, since
the attribute for the setOption -method is Hashtable, what could I use for
the key and what could be the value?

Thanks, Michael

--
Michael König (Dipl.-Math.)
Software Developer
 Tel.: ++49-711/28 43 28-1
  Fax: ++49-711/28 43 28-2
Mobil: 0160/4 40 93 55



Re: Options

Posted by Jeremias Maerki <je...@outline.ch>.
> I saw the code pieces on the metioned website but I did not understand ist:
> 
> Having the driver-object defined in the first box on the site and the
> option -object from the third box, how can I plug the option to the driver?

Well, the documentation might be misleading. You don't have to plug in
anything, because "new Options..." uses static stuff in the background.
So, just do "new Options...." somewhere before your call to FOP and it
should work.

Cheers,
Jeremias Märki

mailto:jeremias.maerki@outline.ch

OUTLINE AG
Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern
Fon +41 41 317 20 20 - Fax +41 41 317 20 29
Internet http://www.outline.ch


RE: Options

Posted by Michael König <Mi...@ms-koenig.de>.
Thanks for your answer.
I saw the code pieces on the metioned website but I did not understand ist:

Having the driver-object defined in the first box on the site and the
option -object from the third box, how can I plug the option to the driver?

Thanks, Michael

--
Michael König (Dipl.-Math.)
Software Developer
 Tel.: ++49-711/28 43 28-1
  Fax: ++49-711/28 43 28-2
Mobil: 0160/4 40 93 55


> -----Original Message-----
> From: Jeremias Maerki [mailto:jeremias.maerki@outline.ch]
> Sent: Tuesday, February 26, 2002 7:50 AM
> To: fop-user@xml.apache.org
> Subject: Re: Options
>
>
> Look here on how to apply the userconfig file:
> http://xml.apache.org/fop/embedding.html
>
[...]



Re: Options

Posted by Jeremias Maerki <je...@outline.ch>.
Look here on how to apply the userconfig file:
http://xml.apache.org/fop/embedding.html

And as for the second question: PDFRenderer, for example, does not
use the setOptions()-facility at the moment.

> I create a DOM-Tree dynamically and put it together with a XSL-file to get a
> PDF.
> 
> But now I have my own font information in the userconfig.xml and need to
> bind it to my
> workflow.
> 
> I gess I found a possibility to to so by using the setOption of a
> PDFRenderer like this:
> ******************************************
> Driver theDriver = new Driver();
> Renderer theREnderer = new PDFRenderer();
> theRenderer.setOptions( <use the userconfig.xml> );
> 
> 
> theDriver.setRenderer(PDFRenderer() );
> theDriver.setInputSource( new DocumentInputSource( getFormatedSource() ) );
> 
> theDriver.setOutputStream( getPDFOutputStream() );
> theDriver.run();
> ********************************************
> 
> Now now I have a Question: Is this the right way and, if so, since
> the attribute for the setOption -method is Hashtable, what could I use for
> the key and what could be the value?
> 

Cheers,
Jeremias Märki

mailto:jeremias.maerki@outline.ch

OUTLINE AG
Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern
Fon +41 41 317 20 20 - Fax +41 41 317 20 29
Internet http://www.outline.ch