org.apache.batik.transcoder.TranscoderException: null

Discussion in 'XML' started by badgerduke@gmail.com, Mar 5, 2008.

  1. Guest

    I get the following exception using Batik (1.7) at the line
    "t.transcode(input, output);" I am trying to convert a DOM into a
    JPEG image.


    org.apache.batik.transcoder.TranscoderException: null
    Enclosed Exception:
    null
    08/03/05 10:42:08 at
    org.apache.batik.transcoder.image.ImageTranscoder.transcode(ImageTranscoder.java:
    132)
    08/03/05 10:42:08 at
    org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(XMLAbstractTranscoder.java:
    142)
    08/03/05 10:42:08 at
    org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(SVGAbstractTranscoder.java:
    156)
    08/03/05 10:42:08 at
    polarity.PolarityServlet.doPost(PolarityServlet.java:95)
    08/03/05 10:42:08 at
    javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
    08/03/05 10:42:08 at
    javax.servlet.http.HttpServlet.service(HttpServlet.java:856)


    SOURCE:

    import org.apache.batik.dom.svg.SAXSVGDocumentFactory;
    import org.apache.batik.transcoder.TranscoderException;
    import org.apache.batik.transcoder.TranscoderInput;
    import org.apache.batik.transcoder.TranscoderOutput;
    import org.apache.batik.transcoder.image.JPEGTranscoder;
    import org.apache.batik.util.XMLResourceDescriptor;
    import org.w3c.dom.svg.SVGDocument;

    .. . . later on . . .


    String parser = XMLResourceDescriptor.getXMLParserClassName();
    SAXSVGDocumentFactory f = new SAXSVGDocumentFactory(parser);
    String uri = new File(getServletContext().getRealPath("/") +
    "svg\\polarity.svg").toURL().toString();
    SVGDocument doc = (SVGDocument) f.createDocument(uri);


    . . . some dom processing here, then . . .


    response.setContentType("image/jpeg");

    JPEGTranscoder t = new JPEGTranscoder();
    t.addTranscodingHint(JPEGTranscoder.KEY_QUALITY, new Float(.
    8));
    TranscoderInput input = new TranscoderInput(doc);
    ServletOutputStream ostream = response.getOutputStream();
    TranscoderOutput output = new TranscoderOutput(ostream);
    try {
    t.transcode(input, output);
    }
    catch (TranscoderException e) {
    e.printStackTrace();
    System.err.println(e.toString());
    }

    ostream.flush();
    ostream.close();

    Anybody have an idea about what this exception is about? Thanks

    badgerduke
     
    , Mar 5, 2008
    #1
    1. Advertising

  2. wrote:
    > I get the following exception using Batik (1.7) at the line
    > "t.transcode(input, output);" I am trying to convert a DOM into a
    > JPEG image.


    Consider to ask on the Batik user list:
    <URL:http://xmlgraphics.apache.org/batik/mailing-lists.html>

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Mar 5, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    999
  2. Dobedani
    Replies:
    0
    Views:
    560
    Dobedani
    May 12, 2005
  3. Replies:
    4
    Views:
    648
    Joseph Kesselman
    Aug 10, 2006
  4. PerlFAQ Server
    Replies:
    0
    Views:
    733
    PerlFAQ Server
    Feb 3, 2011
  5. PerlFAQ Server
    Replies:
    0
    Views:
    740
    PerlFAQ Server
    Apr 4, 2011
Loading...

Share This Page