Gosselin, Michael wrote:


I need it to actually print a rendered PDF file.  I thought the command

        fop.sh -xml foo.xml -xsl foo.xsl -print

Would work, but it doesn't.  I get this output:

[INFO] Using org.apache.xerces.parsers.SAXParser as SAX2 Parser
[INFO] FOP 0.20.5
[INFO] Using org.apache.xerces.parsers.SAXParser as SAX2 Parser
[INFO] building formatting object tree
java.lang.InternalError: Can't connect to X11 window server using ':0.0' as
the
value of the DISPLAY variable.
        at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
        at
sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:138)

As already mentioned the -print option uses the AWT Renderer, which in turn requires an X Windows Server. If you have JDK version > 1.4, then you can modify fop.bat so the call to java has the option

-Djava.awt.headless=true

to get AWT working on a Unix system without X Windows present. But I suspect that printing the AWT version of the document will not be good enough as it will look very different to the PDF.

<snip/>

Chris


Reply via email to