On Jan 25, 2006, at 8:58 AM, Gosselin, Michael wrote:
-----Original Message-----
From: David Delbecq [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, January 25, 2006 11:48 AM
Subject: Re: Printing on HP Unix using FOP

don't know for fop specific, but isn't this shell command 
working on HP-UX?

lp /tmp/generated.pdf

No, because when I do that, all I get is the code for the PDF document.  You
know, the stuff that looks like:

"%PDF-1.3
%~1/21/4!
..."

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)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:142)
        at

<snip>

Michael Gosselin

It looks like you're running your system 'headless' . There's a FAQ[1] related to problems running FOP & Batik headless, and [1] shows some workarounds.

My company had similar problems, which we resolved by outputting to PostScript (-ps), and then `cat`-ing the file to a PostScript printer like this:

fop.sh -xml foo.xml -xsl foo.xsl -ps foo.ps | cat foo.ps > /dev/lp0

HTH!

As a bonus, you can pass the PS file through a PostScript RIP system like GhostScript and generate a PDF file (although it might make more sense to just generate a PDF file in the first place).

[1]

Reply via email to