Juergen Lippold wrote: > 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 > This is most often a symptom of an empty DOM tree. Getting nodes from somewhere into a DOM document can be more tricky than most people think, for example http://marc.theaimsgroup.com/?l=fop-dev&m=101685299217845&w=2
You can use an identity transformer to dump your DOM document onto disk in order to check this: public void generatePdfFile(Document foDocument, String pdfFileName) { //------- dump TransformerFactory.newInstance().newTransformer() .transform(new DOMSource(foDocument),new StreamResult("dump.fo")); //---------- Driver driver = new Driver(); driver.setRenderer(Driver.RENDER_PDF); FileOutputStream fos = null; J.Pietschmann --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]