i use this method and it works fine

 public void createPdf(String xml, String xslPath, String outputPdfPath) throws 
TransformerConfigurationException, TransformerException,
FileNotFoundException, FOPException, IOException
  {

    MessageHandler.setScreenLogger(log);

    FileOutputStream fos=new FileOutputStream(outputPdfPath);

    Driver driver=new Driver();
    driver.setLogger(log);
    driver.setOutputStream(fos);
    driver.setRenderer(Driver.RENDER_PDF);

    StreamSource xmlStreamSource=new StreamSource(new StringReader(xml));

    Transformer transformer=TransformerFactory.newInstance().newTransformer(new 
StreamSource(xslPath));
    transformer.transform(xmlStreamSource, new 
SAXResult(driver.getContentHandler()));

    fos.close();
  }


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to