Package org.apache.batik.transcoder

Examples of org.apache.batik.transcoder.TranscoderInput


     */
    protected TranscoderInput createTranscoderInput() {
  try {
      URL url = resolveURL(inputURI);
      InputStream istream = url.openStream();
      TranscoderInput input = new TranscoderInput(istream);
      input.setURI(url.toString()); // Needed for external resources
      return input;
  } catch (IOException ex) {
            throw new IllegalArgumentException(inputURI);
  }
    }
View Full Code Here


    /**
     * Creates the <tt>TranscoderInput</tt>.
     */
    protected TranscoderInput createTranscoderInput() {
  return new TranscoderInput(resolveURL(inputURI).toString());
    }
View Full Code Here

     */
    protected TranscoderInput createTranscoderInput() {
  try {
      URL url = resolveURL(inputURI);
      Reader reader = new InputStreamReader(url.openStream());
      TranscoderInput input = new TranscoderInput(reader);
      input.setURI(url.toString()); // Needed for external resources
      return input;
  } catch (IOException ex) {
            throw new IllegalArgumentException(inputURI);
  }
    }
View Full Code Here

    /**
     * Creates the <tt>TranscoderInput</tt>.
     */
    protected TranscoderInput createTranscoderInput() {
  return new TranscoderInput(resolveURL(inputURI).toString());
    }
View Full Code Here

    /**
     * Creates the <tt>TranscoderInput</tt>.
     */
    protected TranscoderInput createTranscoderInput() {
  return new TranscoderInput(resolveURL(inputURI).toString());
    }
View Full Code Here

    protected TranscoderInput createTranscoderInput() {
  try {
      String parser = XMLResourceDescriptor.getXMLParserClassName();
      SAXSVGDocumentFactory f = new SAXSVGDocumentFactory(parser);
      Document doc = f.createDocument(resolveURL(inputURI).toString());
      return new TranscoderInput(doc);
  } catch (IOException ex) {
            throw new IllegalArgumentException(inputURI);
  }
    }
View Full Code Here

    /**
     * Creates the <tt>TranscoderInput</tt>.
     */
    protected TranscoderInput createTranscoderInput() {
  return new TranscoderInput(resolveURL(inputURI).toString());
    }
View Full Code Here

  public synchronized ByteArrayOutputStream transcode(
      ByteArrayOutputStream stream, String svg, MimeType mime,
      Float width, Float scale) throws SVGRasterizerException,
      TranscoderException {

    TranscoderInput input = new TranscoderInput(new StringReader(svg));
    TranscoderOutput transOutput = new TranscoderOutput(stream);
    // get right Transcoder, this depends on the mime
    SVGAbstractTranscoder transcoder = SVGRasterizer.getTranscoder(mime);

    if (width != null) {
View Full Code Here

      }
       */
    insertImage(userdata, clone); // special dravel for demo

      PrintTranscoder t = new PrintTranscoder();
    TranscoderInput input = new TranscoderInput(clone);
    TranscoderOutput output = new TranscoderOutput(new ByteArrayOutputStream());
    t.transcode(input, output);
    {
      final String aDoNot = clone.getRootElement().getAttribute("doNotScaleToPage");
      t.addTranscodingHint( PrintTranscoder.KEY_SCALE_TO_PAGE,
View Full Code Here

        // create a servlet
        ImageTranscoder bufferedImgTranscoder =
            new BufferedImageTranscoder();

        TranscoderInput transcoderInput =
            new TranscoderInput(imageInputStreamAdaptor);

        // create the servlet output
        BufferedImageTranscoderOutput output =
            new BufferedImageTranscoderOutput();

        // perform the transcoding
        try {
            bufferedImgTranscoder.transcode(transcoderInput, output);
        } catch (TranscoderException e) {
            String imagePath = transcoderInput.getURI();
            logger.error("svg-transcoding-error", imagePath, e);
            throw new IOException(e.getLocalizedMessage());
        }
        return output.getBufferedImage();
    }
View Full Code Here

TOP

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

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.