Package org.apache.batik.transcoder

Examples of org.apache.batik.transcoder.TranscoderOutput


        TranscoderInput transcoderInput = new TranscoderInput(svgDoc);
        Reader stringReader = new StringReader(inputString);
        TranscoderInput transcoderInput2 = new TranscoderInput(stringReader);
        // Create the transcoder output.
        OutputStream osByteArray = new ByteArrayOutputStream();
        TranscoderOutput transcoderOutput = new TranscoderOutput(osByteArray);
        try {
            jpegTranscoder.transcode(transcoderInput2, transcoderOutput);
        } catch (TranscoderException e) {
            log.error("JPEGTranscoder error", e);
            return null;
View Full Code Here


        TranscoderInput transcoderInput = new TranscoderInput(svgDoc);
        Reader stringReader = new StringReader(inputString);
        TranscoderInput transcoderInput2 = new TranscoderInput(stringReader);
        // Create the transcoder output.
        OutputStream osByteArray = new ByteArrayOutputStream();
        TranscoderOutput transcoderOutput = new TranscoderOutput(osByteArray);
        try {
            jpegTranscoder.transcode(transcoderInput2, transcoderOutput);
        } catch (TranscoderException e) {
            log.error("JPEGTranscoder transcode error", e);
            return null;
View Full Code Here

        //TranscoderInput transcoderInput = new TranscoderInput(svgDoc);
        Reader stringReader = new StringReader(inputString);
        TranscoderInput transcoderInput = new TranscoderInput(stringReader);
       
        // Create the transcoder output.
        TranscoderOutput transcoderOutput = new TranscoderOutput(os);
        try {
            pngTranscoder.transcode(transcoderInput, transcoderOutput);
        } catch (TranscoderException te) {
          // code compatible with jdk 1.5
            IOException ioe = new IOException("Transcoder error");
View Full Code Here

        String inputString = svg.getHeaders() + svg.generateSVGString();
       
        Reader stringReader = new StringReader(inputString);
        TranscoderInput transcoderInput2 = new TranscoderInput(stringReader);
       
        TranscoderOutput transcoderOutput = new TranscoderOutput(os);
        try {
            jpegTranscoder.transcode(transcoderInput2, transcoderOutput);
        } catch (TranscoderException te) {
          // code compatible with jdk 1.5
            IOException ioe = new IOException("Transcoder error");
View Full Code Here

        Rasterizer r = new Rasterizer();
        JPEGTranscoder jpeg = new JPEGTranscoder();
        r.setTranscodingHints((Map) hints);
        File file = new File("image.jpg");
        FileWriter fw = new FileWriter(file);
        TranscoderOutput output = new TranscoderOutput(fw);
        r.transcode(input, output);
        r.setTranscodingHints((Map) hints);
        jpeg.transcode(input, output);
        return img;
    }
View Full Code Here

    }
  
    private void transcode(String inputFile, BufferedImageTranscoder transcoder) throws Exception {
        InputStream in = new FileInputStream(inputFile);
        TranscoderInput input = new TranscoderInput(in);
        TranscoderOutput output = new TranscoderOutput();
        transcoder.transcode(input, output);   
    }
View Full Code Here

        // sets transcoder input and output
        TranscoderInput input = new TranscoderInput(doc);

        // performs transcoding
        try {
            TranscoderOutput output = new TranscoderOutput(writer);
            t.transcode(input, output);
        } finally {
            writer.close();
        }
View Full Code Here

      ByteArrayOutputStream stream, String svg, MimeType mime, Float width)
      throws SVGRasterizerException, TranscoderException {

    TranscoderInput input = new TranscoderInput(new StringReader(svg));
    // Create the transcoder output
    TranscoderOutput transOutput = new TranscoderOutput(stream);
    // get right Transcoder, depends on mime
    SVGAbstractTranscoder transcoder = SVGRasterizer.getTranscoder(mime);
    if (width != null) {
      /*
       * If the raster image height is not provided (using the
View Full Code Here

      try {
        TranscoderInput input = new TranscoderInput(svgFile.toURI().toString());
        pngFile.createNewFile();
       
        OutputStream ostream = new FileOutputStream(pngFile);
        TranscoderOutput output = new TranscoderOutput(ostream);
       
        t.transcode(input, output);
        ostream.flush();
        ostream.close();
       
View Full Code Here

        String svgURI = new File("/Users/nare4013/epub/rackspace-template/rackspace-template/target/docbkx/images/cloud/cover.svg").toURI().toURL().toString();
        TranscoderInput input = new TranscoderInput(svgURI);

        // Create the transcoder output.
        OutputStream ostream = new FileOutputStream("/Users/nare4013/epub/rackspace-template/rackspace-template/target/docbkx/images/cloud/cover.png");
        TranscoderOutput output = new TranscoderOutput(ostream);

        // Save the image.
        t.transcode(input, output);

        // Flush and close the stream.
View Full Code Here

TOP

Related Classes of org.apache.batik.transcoder.TranscoderOutput

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.