Hi Saehoon,

"Saehoon Cheon" <[EMAIL PROTECTED]> wrote on 08/16/2007 08:39:20 PM:

> But it causes error.
> The error is occurred "t.transcode(input, output);"  and  the 
> message is " org.apache.batik.transcoder.TranscoderException: null".
> I think that the code is not reading correct file from folder or 
> writing file to folder.

   Yes, this is the problem:

>         // Create the transcoder input.
>         String svgURI = new File("C:/tmp/svgtest.svg").toString();
>         TranscoderInput input = new TranscoderInput(svgURI); 

    Your svgURI is not a URI it's a file path.  Try using
the method: File.toURI().


> 
>         // Create the transcoder output.
>         OutputStream ostream = new FileOutputStream("C:/tmp/out.jpg");
>         TranscoderOutput output = new TranscoderOutput(ostream);
> 
>         try{ 
>             // Save the image.
>             t.transcode(input, output); 
> <<<<<<<<==================== null exception 
>         }catch (TranscoderException ex) {
>             ex.printStackTrace();
>         }
> 
>         // Flush and close the stream.
>         ostream.flush();
>         ostream.close();
>         System.exit (0);
> 
======================================================================================
> -- 
> Saehoon Cheon
> The University of Arizona
> Dept.Electrical and Computer Engineering 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to