You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by "Lewis, Bobby" <bl...@aivia.net> on 2002/03/01 18:19:53 UTC

converting SVG to PDF

I'm running the example that comes with fop, embedding.fo (in
examples/svg/). When I do it command line (to convert this XSLFO that
contains SVG into a PDF), it works fine. I open the PDF and see a picture of
a tiger.  

Now, I try to do it on the web. The JSP (that works correctly with examples
like border.fo that do NOT use SVG) takes an XSLFO file, and converts it to
PDF, then returns the byte stream with a header of application/pdf. When I
try it with the SVG FO file, I get:

Can't connect to X11 window server using ':0.0' as the value of the DISPLAY
variable.


It's like it's trying to render the SVG to a display on the server side. I'm
explicitly calling 	driver.setRenderer(Driver.RENDER_PDF);
so that it renders PDF and not AWT or Print or something else. I get this
stack trace BEFORE the driver.run method returns (it's all happening
somewhere in the conversion process):

[02.03.01 10:19:12:344 CST] 46e06145 SystemOut     U reading user
configuration file

[02.03.01 10:19:12:349 CST] 46e06145 SystemOut     U building formatting
object tree

[02.03.01 10:19:12:350 CST] 46e06145 SystemOut     U setting up fonts

[02.03.01 10:19:12:475 CST] 46e06145 SystemOut     U  [1
[02.03.01 10:19:13:443 CST] 46e06145 WebGroup      X Servlet Error:
Can&#39;t connect to X11 window server using &#39;:0.0&#39; as the value of
the DISPLAY variable.: java.lang.Exception: Can't connect to X11 window
server using ':0.0' as the value of the DISPLAY variable.
        at jsp.pdf_jsp_23._jspService(pdf_jsp_23.java:154)
        at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:139)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.ja
va:286)
        at
org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:415)
        at org.apache.jasper.runtime.JspServlet.service(JspServlet.java:544)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
com.ibm.servlet.engine.webapp.StrictServletInstance.doService(ServletManager
.java:827)

Any help is appreciated.

Bobby Lewis
Solutions Architect
Aivia
3100 McKinnon Suite 1000
Dallas, TX 75201 

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Re: converting SVG to PDF

Posted by fred redf <po...@yahoo.fr>.
You're right. I'm going to read your previous post.
Sorry for my dirty solution...
Fred.

--- James Richardson <ja...@db.com> a
écrit : > fred redf wrote:
> 
> > 
> > 
> > Hi Boby,
> > 
> > The prob is that svg renderer *need* to connect to
> an
> > X11 server cause batik relies on AWT. When you run
> it
> > via the command line there is no prob (assuming
> you
> > actually are connected to some kind of X11
> server). I
> > found a workaround by running servlet container in
> a
> > shell where i export correct DISPLAY variable
> first. I
> > know it's a little bit dirty but i don't know any
> > better solution...
> >
> 
> 
> Please see my post re PJA for a solution about this,
> or use Xvfb.
> 
> Setting the DISPLAY variable is going to cause you
> big problems if the X 
> server you are connected to goes down.
> 
> cheers
> 
> james
> 
> 
> 
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> fop-dev-unsubscribe@xml.apache.org
> For additional commands, email:
> fop-dev-help@xml.apache.org
>  

___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Re: converting SVG to PDF

Posted by James Richardson <ja...@db.com>.
fred redf wrote:

> 
> 
> Hi Boby,
> 
> The prob is that svg renderer *need* to connect to an
> X11 server cause batik relies on AWT. When you run it
> via the command line there is no prob (assuming you
> actually are connected to some kind of X11 server). I
> found a workaround by running servlet container in a
> shell where i export correct DISPLAY variable first. I
> know it's a little bit dirty but i don't know any
> better solution...
>


Please see my post re PJA for a solution about this, or use Xvfb.

Setting the DISPLAY variable is going to cause you big problems if the X 
server you are connected to goes down.

cheers

james






---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Re: converting SVG to PDF

Posted by fred redf <po...@yahoo.fr>.
Hi Boby,

The prob is that svg renderer *need* to connect to an
X11 server cause batik relies on AWT. When you run it
via the command line there is no prob (assuming you
actually are connected to some kind of X11 server). I
found a workaround by running servlet container in a
shell where i export correct DISPLAY variable first. I
know it's a little bit dirty but i don't know any
better solution...

--- "Lewis, Bobby" <bl...@aivia.net> a écrit : > I'm
running the example that comes with fop,
> embedding.fo (in
> examples/svg/). When I do it command line (to
> convert this XSLFO that
> contains SVG into a PDF), it works fine. I open the
> PDF and see a picture of
> a tiger.  
> 
> Now, I try to do it on the web. The JSP (that works
> correctly with examples
> like border.fo that do NOT use SVG) takes an XSLFO
> file, and converts it to
> PDF, then returns the byte stream with a header of
> application/pdf. When I
> try it with the SVG FO file, I get:
> 
> Can't connect to X11 window server using ':0.0' as
> the value of the DISPLAY
> variable.
> 
> 
> It's like it's trying to render the SVG to a display
> on the server side. I'm
> explicitly calling 
> driver.setRenderer(Driver.RENDER_PDF);
> so that it renders PDF and not AWT or Print or
> something else. I get this
> stack trace BEFORE the driver.run method returns
> (it's all happening
> somewhere in the conversion process):
> 
> [02.03.01 10:19:12:344 CST] 46e06145 SystemOut     U
> reading user
> configuration file
> 
> [02.03.01 10:19:12:349 CST] 46e06145 SystemOut     U
> building formatting
> object tree
> 
> [02.03.01 10:19:12:350 CST] 46e06145 SystemOut     U
> setting up fonts
> 
> [02.03.01 10:19:12:475 CST] 46e06145 SystemOut     U
>  [1
> [02.03.01 10:19:13:443 CST] 46e06145 WebGroup      X
> Servlet Error:
> Can't connect to X11 window server using
> ':0.0' as the value of
> the DISPLAY variable.: java.lang.Exception: Can't
> connect to X11 window
> server using ':0.0' as the value of the DISPLAY
> variable.
>         at
> jsp.pdf_jsp_23._jspService(pdf_jsp_23.java:154)
>         at
>
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:139)
>         at
>
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>         at
>
org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.ja
> va:286)
>         at
>
org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:415)
>         at
>
org.apache.jasper.runtime.JspServlet.service(JspServlet.java:544)
>         at
>
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>         at
>
com.ibm.servlet.engine.webapp.StrictServletInstance.doService(ServletManager
> .java:827)
> 
> Any help is appreciated.
> 
> Bobby Lewis
> Solutions Architect
> Aivia
> 3100 McKinnon Suite 1000
> Dallas, TX 75201 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> fop-dev-unsubscribe@xml.apache.org
> For additional commands, email:
> fop-dev-help@xml.apache.org
>  

___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org