You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by "Kenneth B. Harwood" <ru...@comcast.net> on 2005/07/28 23:18:54 UTC

Re: Batik Servlet

This thread (originally started on 11-November-2004) was
very helpful.  TW's posted advice (see below) just solved
my (almost identical) problem.

I was trying to convert a (200 KB) .svg to a (thumbnail-
sized) .jpg using batik's transcoder API.  My configuration:

Batik 1.6
J2SE 5.0
Tomcat 5.5.9
Win2K Pro

I  experienced the same sort of "TranscoderException":
Enclosed exception:null ... The URI "#linearGradient ...
is invalid ..

BTW, TW's code solution has incorrect syntax.  Here's my
modification:

        in.setURI(f.toURI().toString()); 

Regards,

 - Kenneth Harwood

-------------------------------------------------------

On Thu, 11 Nov 2004 06:02:00 -0500, Thomas DeWeese
<th...@kodak.com> wrote:
> Rob wrote:
> > Further to my previous email to the mailing list, I've now tried the following:
> 
> [...]
> 
> > That much nicer I think, but I still get an error unfortunately. The
> > error now is:
> > Exception in thread "main" org.apache.batik.transcoder.TranscoderException: null
> >
> > Enclosed Exception:
> > null:-1
> > The URI "#linearGradient7024"
> > specified on the element <linearGradient> is invalid
> 
> This is probably due to the use of streams. With a stream it
> doesn't know the 'base URL' for the document. I had thought that
> we had worked this out for internal references but it appears there
> is at least a few cases we missed. Anyway I think the fix is simple:
> 
> File f = new File("c:\\temp\\1.svg");
> FileInputStream is = new FileInputStream(f);
> TranscoderInput in = new TranscoderInput(is);
> in.setURI(f.toURL());