I just set up a servlet that is based on the JPEGTranscode sample code.  My
SvgToJpg servlet passes the 
URL TranscoderInput.  That URL is another servlet which generates SVG
output.  The output image is large.  It takes up most of an entire page.  

The problem is my JPEG-converted image is clippinp off about half of what
the SVG should show.  I've confirmed that the SVG, if displayed with an
appropriate viewer, is correctly generating the full image.  It's just the
conversion that chops off the bottom half.  

I thought that the KEY_HEIGHT Hint would do the trick, but that simply
scales the clipped image up in size.  The missing portion is still missing.
I've looked carefully through the other Hints, but no others seem to apply.
Is there some other means of telling the transcoder that my image is bigger
than the box it's painting?


The servlet snipet:

throws IOException, ServletException
        {
                String theURL = new String();
                String theHeight = new String();
                theURL = request.getParameter("theURL");
                theHeight = request.getParameter("theHeight");
                System.out.println("theURL: " + theURL + ", theHeight: " +
theHeight);

                ostream         = response.getOutputStream();
                JPEGTranscoder t = new JPEGTranscoder();
                t.addTranscodingHint(   JPEGTranscoder.KEY_QUALITY, new
Float(.6));
                t.addTranscodingHint(   JPEGTranscoder.KEY_HEIGHT, new
Float(theHeight));

                //get the url as a stream
                TranscoderInput input = new TranscoderInput(theURL);
                TranscoderOutput output = new TranscoderOutput(ostream);
                try {
                        t.transcode(input, output);
                }catch (Exception e) {
                        System.out.println("Transcoder fails:"+e);
                }
                ostream.flush();
                ostream.close();
                input = null;
                output = null;
                ostream = null;
                t = null;
        }

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

Reply via email to