org.apache.batik.transcoder.wmf.tosvg
public class WMFTranscoder extends ToSVGAbstractTranscoder
This class is copied from batik org.apache.batik.transcoder.wmf.tosvg.WMFTranscoder class.
It can use TranscoderInput that are either a URI or a InputStream or a Reader. The XMLReader and Document TranscoderInput types are not supported.
This transcoder can use TranscoderOutputs that are of any type except the XMLFilter type.
Corrected bugs from the original class:
Exemple of use :
WMFTranscoder transcoder = new WMFTranscoder(); try { TranscoderInput wmf = new TranscoderInput(wmffile.toURL().toString()); FileOutputStream fos = new FileOutputStream(svgFile); TranscoderOutput svg = new TranscoderOutput(new OutputStreamWriter(fos, "UTF-8")); transcoder.transcode(wmf, svg); } catch (MalformedURLException e){ throw new TranscoderException(e); } catch (IOException e){ throw new TranscoderException(e); }
Several transcoding hints are available for this transcoder :
transcoder.addTranscodingHint(FromWMFTranscoder.KEY_INPUT_WIDTH, new Integer(input_width));
transcoder.addTranscodingHint(FromWMFTranscoder.KEY_WIDTH, new Float(width));
Field Summary | |
---|---|
static String | SVG_EXTENSION |
static String | WMF_EXTENSION |
Constructor Summary | |
---|---|
WMFTranscoder()
Default constructor |
Method Summary | |
---|---|
static void | main(String[] args)
Unit testing : Illustrates how the transcoder might be used. |
void | transcode(TranscoderInput input, TranscoderOutput output)
Transcodes the specified input in the specified output. |
Parameters: input the input to transcode output the ouput where to transcode
Throws: TranscoderException if an error occured while transcoding