Baptiste Casanova wrote:
Hi Markus,
How could i do the same thing with embedded FOP ?

You have to get hold of the transformer object so that you can use setparameter().

An example:

 ByteArrayOutputStream out=new ByteArrayOutputStream();
 // set up the Driver object
 Driver driver =new Driver();
 driver.setOutputStream(out);
 driver.setRenderer(Driver.RENDER_PDF);
 // get a Transformer object
 Transformer transformer=TransformerFactory.newInstance()
  .newTransformer(new StreamSource(new File("foo.xsl")));
 // set a oparameter
 transformer.setParameter("page-count","126");
 // start the transformation, this will also drive
 // the renderer
 transformer.transform(new StreamSource(new File("foo.xml")),
   new SAXResult(driver.getContentHandler()));

HTH
J.Pietschmann



Reply via email to