public BufferedImage makeAWTImage ( int width , int height ) throws TranscoderException { ThumbnailTranscoder t = new ThumbnailTranscoder ( ) ; t . addTranscodingHint ( PNGTranscoder . KEY_WIDTH , new Float ( width ) ) ; t . addTranscodingHint ( PNGTranscoder . KEY_HEIGHT , new Float ( height ) ) ; // Don't clone. Assume this is used safely. TranscoderInput input = new TranscoderInput ( document ) ; t . transcode ( input , null ) ; return t . getLastImage ( ) ; }
Convert the SVG to a thumbnail image .