xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thomas.dewe...@kodak.com
Subject Re: Displaying JPEG file in SVG in batik
Date Thu, 22 Jun 2006 10:12:15 GMT
Hi Kok Eng Meo,

   Please only send messages to one list, in this case the 'users' list
since you are not developing Batik, you are developing code that uses 
Batik.

"kok eng meo" <dstamkokeng@gmail.com> wrote on 06/22/2006 03:52:58 AM:

> I have tried to create an image Element in batik to display a jpeg file. 
But 
> it does not work.
> This is my code.

     I don't see any obvious problems (points for getting
the namespace stuff "first try").

> abc.setAttributeNS(XMLConstants.XLINK_NAMESPACE_URI, "xlink:href", 
"picture.jpg");

> The error given is an I/O error occurred while processing the URI

    Ohh, you just lost the points for not including the I/O 
error stack trace ;)

    I/O error covers a lot, my first guess is that it can't find the
JPEG.  If you are constructing the SVG document entirely in memory
(nothing read from disk) the document likely has no 'base URL' to
resolve relative URL's (like "picture.jpg").  I would suggest that
you provide a base URL either by setting the xml:base attribute
(in the xml namespace), or by calling 
'batik.dom.svg.SVGOMDocument.setURLObject(URL)'

> Can someone please advice me on this?? Or is there any other methods to 
> display a jpeg file inside batik SVGDocument.

   No this is it...


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Mime
View raw message