Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

error from FO to PDF using FOP

Help
2008-04-15
2013-06-04
  • Alex Smorodin
    Alex Smorodin
    2008-04-15

    first of all, sorry for my english.
    i try to covert from html to fo using http://html2fo.sourceforge.net/testsuite/table.html - that's good.
    but then i try to convert to pdf format,using FOP and i get an errors

    [root@smorodin /tmp/test]# fop -fo table.fo -pdf table.pdf
    15.04.2008 11:13:59 org.apache.fop.cli.Main startFOP
    SEVERE: Exception
    javax.xml.transform.TransformerException: org.apache.fop.fo.ValidationException: file:///tmp/test/table.fo:6:38: Error(6/38): For fo:simple-page-master, fo:region-body must be declared before fo:region-before.
            at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:168)
            at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
            at org.apache.fop.cli.Main.startFOP(Main.java:166)
            at org.apache.fop.cli.Main.main(Main.java:197)

    ---------

    javax.xml.transform.TransformerException: org.apache.fop.fo.ValidationException: file:///tmp/test/table.fo:6:38: Error(6/38): For fo:simple-page-master, fo:region-body must be declared before fo:region-before.
            at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:501)
            at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:165)
            at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
            at org.apache.fop.cli.Main.startFOP(Main.java:166)
            at org.apache.fop.cli.Main.main(Main.java:197)
    Caused by: org.apache.fop.fo.ValidationException: file:///tmp/test/table.fo:6:38: Error(6/38): For fo:simple-page-master, fo:region-body must be declared before fo:region-before.
            at org.apache.fop.fo.FONode.nodesOutOfOrderError(FONode.java:382)
            at org.apache.fop.fo.pagination.SimplePageMaster.validateChildNode(SimplePageMaster.java:129)
            at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder.java:302)
            at org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:185)
            at org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1072)
            at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
            at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
            at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
            at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
            at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
            at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
            at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
            at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
            at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
            at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:484)
            ... 4 more
    ---------
    org.apache.fop.fo.ValidationException: file:///tmp/test/table.fo:6:38: Error(6/38): For fo:simple-page-master, fo:region-body must be declared before fo:region-before.
            at org.apache.fop.fo.FONode.nodesOutOfOrderError(FONode.java:382)
            at org.apache.fop.fo.pagination.SimplePageMaster.validateChildNode(SimplePageMaster.java:129)
            at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder.java:302)
            at org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:185)
            at org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1072)
            at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
            at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
            at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
            at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
            at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
            at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
            at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
            at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
            at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
            at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:484)
            at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:165)
            at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
            at org.apache.fop.cli.Main.startFOP(Main.java:166)
            at org.apache.fop.cli.Main.main(Main.java:197)
    [root@smorodin /tmp/test]#    

      OS 6.2-RELEASE-p7.  html2fo-0.4.2  fop-0.94

    Thank you 

     
    • html2fo supports only fop up to version 0.20.5. If you rely on the 0.9x versions of fop I will have a look into the html2fo sources for supporting the new version.