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 Albert Valls <av...@ngeografics.com> on 2001/09/26 10:02:04 UTC

org.apache.batik.transcoder.TranscoderException: space

I'm using the SVGTranscoder to save a SVG file. With one of the files works fine but with another gives this Exception when executing:

   org.apache.batik.transcoder.TranscoderException: space
        at org.apache.batik.transcoder.svg2svg.PrettyPrinter.fatalError(PrettyPrinter.java:1685)
        at org.apache.batik.transcoder.svg2svg.PrettyPrinter.printPI(PrettyPrinter.java:498)
        at org.apache.batik.transcoder.svg2svg.PrettyPrinter.printContent(PrettyPrinter.java:937)
        at org.apache.batik.transcoder.svg2svg.PrettyPrinter.printElement(PrettyPrinter.java:899)
        at org.apache.batik.transcoder.svg2svg.PrettyPrinter.print(PrettyPrinter.java:242)
        at org.apache.batik.transcoder.svg2svg.SVGTranscoder.prettyPrint(SVGTranscoder.java:222)
        at org.apache.batik.transcoder.svg2svg.SVGTranscoder.transcode(SVGTranscoder.java:178)
        at SVGDOMUtils.saveToSVG(SVGDOMUtils.java:338)

What space is referring to ?? Which is the problem ??

The code:

   FileOutputStream outputS = new FileOutputStream(path);
   Writer outS= new OutputStreamWriter(outputS, "UTF-8");
   TranscoderInput inputS = new TranscoderInput(doc);
   TranscoderOutput outputS2 = new TranscoderOutput(outS);
   SVGTranscoder t = new SVGTranscoder();
   //t.addTranscodingHint(SVGTranscoder.KEY_DOCTYPE,false );
   t.transcode(inputS, outputS2);    // this is the line 338




Re: org.apache.batik.transcoder.TranscoderException: space

Posted by Stephane Hillion <sh...@ilog.fr>.
On Wednesday 26 September 2001 10:02, Albert Valls wrote:
> I'm using the SVGTranscoder to save a SVG file. With one of the files works
> fine but with another gives this Exception when executing:
>
>    org.apache.batik.transcoder.TranscoderException: space
>         at
> org.apache.batik.transcoder.svg2svg.PrettyPrinter.fatalError(PrettyPrinter.
>java:1685) at
> org.apache.batik.transcoder.svg2svg.PrettyPrinter.printPI(PrettyPrinter.jav
>a:498) at
> org.apache.batik.transcoder.svg2svg.PrettyPrinter.printContent(PrettyPrinte
>r.java:937) at
> org.apache.batik.transcoder.svg2svg.PrettyPrinter.printElement(PrettyPrinte
>r.java:899) at
> org.apache.batik.transcoder.svg2svg.PrettyPrinter.print(PrettyPrinter.java:
>242) at
> org.apache.batik.transcoder.svg2svg.SVGTranscoder.prettyPrint(SVGTranscoder
>.java:222) at
> org.apache.batik.transcoder.svg2svg.SVGTranscoder.transcode(SVGTranscoder.j
>ava:178) at SVGDOMUtils.saveToSVG(SVGDOMUtils.java:338)
>
> What space is referring to ?? Which is the problem ??
>
> The code:
>
>    FileOutputStream outputS = new FileOutputStream(path);
>    Writer outS= new OutputStreamWriter(outputS, "UTF-8");
>    TranscoderInput inputS = new TranscoderInput(doc);
>    TranscoderOutput outputS2 = new TranscoderOutput(outS);
>    SVGTranscoder t = new SVGTranscoder();
>    //t.addTranscodingHint(SVGTranscoder.KEY_DOCTYPE,false );
>    t.transcode(inputS, outputS2);    // this is the line 338

Your code is correct. There was bug in the pretty-printer, related with the 
processing instructions. It should be fixed in the next release of batik.

Thanks,
  Stephane.

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