You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by La...@i2.com on 2002/10/14 22:34:03 UTC

FOP/Batik problem with url(#id)

I'm using FOP 0.20.4 to transform SVG into PDF from a jsp page (wrote my 
own JSP tag to invoke FOP).  The content uses url(#id) in various places 
(example below).
<svg:pattern id="sbBgPatt" preserveAspectRatio="xMidYMid meet" width="2" 
height="2" patternUnits="userSpaceOnUse" shape-rendering="optimizeSpeed">
<svg:rect x="0" y="0" width="2" height="2" fill="white"/>
<svg:rect x="0" y="0" width="1" height="1" fill="rgb(102,204,255)"/>
<svg:rect x="1" y="1" width="1" height="1" fill="rgb(102,204,255)"/>
</svg:pattern>
<svg:rect fill="url(#sbBgPatt)" height="16" width="716" x="105" y="532"/>

If I execute FOP from a command line, no errors occur.  However from 
within my JSP environment, I get an exception (listed at end of message) 
while it is trying to process the url.  If I remove all usages of 
url(#id), then everything works fine.

A reply from a post to the Batik mailing list offered a suggestion to use 
Batik 1.5 beta 4.  Is FOP 0.20.4 compatible with it?  If so, does anyone 
have a distribution I can use?  I tried to build a large jar file for 
Batik (by using the files from the 18 jars in the Batik distribution) that 
mimics the one shipped with the FOP distribution but now nothing works!

I haven't tried it myself, but can the FopServlet handle url(#id) ?  If 
so, then my JSP should work as well right?

TIA,
Larry Mason

java.lang.NullPointerException
        at java.net.URL.<init>(URL.java:366)
        at java.net.URL.<init>(URL.java:329)
        at java.net.URL.<init>(URL.java:321)
        at java.net.URL.<init>(URL.java:252)
        at java.net.URL.<init>(URL.java:275)
        at org.apache.batik.util.ParsedURLData.buildURL(Unknown Source)
        at org.apache.batik.util.ParsedURLData.openStreamInternal(Unknown 
Source)
        at org.apache.batik.util.ParsedURLData.openStream(Unknown Source)
        at org.apache.batik.util.ParsedURL.openStream(Unknown Source)
        at 
org.apache.batik.dom.svg.SAXSVGDocumentFactory.createDocument(Unknown 
Source)
        at org.apache.batik.bridge.DocumentLoader.loadDocument(Unknown 
Source)
        at org.apache.batik.bridge.URIResolver.getNode(Unknown Source)
        at org.apache.batik.bridge.URIResolver.getElement(Unknown Source)
        at 
org.apache.batik.bridge.BridgeContext.getReferencedElement(Unknown Source)
        at org.apache.batik.bridge.PaintServer.convertURIPaint(Unknown 
Source)
        at org.apache.batik.bridge.PaintServer.convertPaint(Unknown 
Source)
...

Re: FOP/Batik problem with url(#id)

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Larry_Mason@i2.com wrote:
...
> If I execute FOP from a command line, no errors occur.  However from 
> within my JSP environment, I get an exception (listed at end of message) 
> while it is trying to process the url.  If I remove all usages of 
> url(#id), then everything works fine.
> 
> A reply from a post to the Batik mailing list offered a suggestion to use 
> Batik 1.5 beta 4.  Is FOP 0.20.4 compatible with it?
No (interface changed).

> I haven't tried it myself, but can the FopServlet handle url(#id) ?
It depends.

>  If 
> so, then my JSP should work as well right?

Try to set baseDir in the configuration, see
  http://marc.theaimsgroup.com/?l=fop-dev&m=101777546120252&w=2

J.Pietschmann