Hello,

I'm looking for a way to convert a org.w3c.dom.Document with the FO-Format directly to 
a PDF-File.
The following code is running if I use the xxxxx.fo-File written to the harddisk.
Using the document from memory I get an error:

[INFO]: building formatting object tree
[ERROR]: Unknown formatting object null^null

Who has an idea where I can search for the solution.
Does someone knows the reason for the error?
Thanks 

Juergen Lippold

public void generatePdfFile(Document foDocument, String pdfFileName) {
    Driver driver = new Driver();
    driver.setRenderer(Driver.RENDER_PDF);

    FileOutputStream fos = null;
    try {
      fos = new FileOutputStream(pdfFileName);
            
      driver.setRenderer(Driver.RENDER_PDF);
      driver.setInputSource(new DocumentInputSource(foDocument));
      //driver.setInputSource(new InputSource("D:\\LpJ\\ExportTest\\xxxxx.fo"));
      driver.setOutputStream(fos);
     driver.run();
    }
    catch (Exception e) {
      }
    finally {
      try {
        if (fos != null) fos.close(); 
      }
      catch (Exception e) {} 
    }
  }


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

Reply via email to