Package org.apache.batik.svggen

Examples of org.apache.batik.svggen.SVGGraphics2D.stream()


              // UTF-8 encoding.
              boolean useCSS = true; // we want to use CSS style attributes
   
              Writer out = new OutputStreamWriter(stream,
                  "UTF-8");
              svgGenerator.stream(out, useCSS);
            } else if (filter.type == FORMAT_PDF) {
              com.itextpdf.text.Document document = new com.itextpdf.text.Document(new Rectangle(width, height));
              PdfWriter writer = PdfWriter.getInstance(document, stream);
              document.open();
              PdfContentByte cb = writer.getDirectContent();
View Full Code Here


        log.debug("working_dir: " + uploadTempDir);
        String reqFilePrefix = fileName + "_" + CalendarPatterns.getTimeForStreamId(new Date());
        File svgFile = new File(uploadTempDir, reqFilePrefix + ".svg");
        log.debug("exported svg file: " + svgFile.getCanonicalPath());
        FileWriter out = new FileWriter(svgFile);
        svgGenerator.stream(out, useCSS);
        out.flush();
        out.close();
        File expFile = new File(uploadTempDir, reqFilePrefix + "." + exportType);
        log.debug("exported file: " + expFile.getCanonicalPath());
        if ("svg".equals(exportType)) {
View Full Code Here

             draw(svgGenerator);

             Writer out = new BufferedWriter(new FileWriter(selecteddFile));
             //logger.info("Writing output");
             svgGenerator.stream(out, false);
             //logger.info("Done");
         } catch (Exception e) {
             MessageUtils.showMessage("Error encountered creating SVG file: " + e.toString());
         }
     }
View Full Code Here

        try {
            // Finally, stream out SVG to the standard output using
            // UTF-8 encoding.
            boolean useCSS = true; // we want to use CSS style attributes
            out = new BufferedWriter(new OutputStreamWriter( new FileOutputStream(selectedFile), "UTF-8"));
            svgGenerator.stream(out, useCSS);
        } finally {
            if (out != null) try {
                out.close();
            } catch (IOException e) {
                log.error("Error closing svg file", e);
View Full Code Here

        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        OutputStreamWriter osw = new OutputStreamWriter(bos, "UTF-8");
        try{
            painter.paint(g2d);
            configureSVGGraphics2D(g2d);
            g2d.stream(osw);
            osw.flush();
            bos.flush();
            bos.close();
        }catch(Exception e){
            StringWriter trace = new StringWriter();
View Full Code Here

        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        OutputStreamWriter osw = new OutputStreamWriter(bos, "UTF-8");
        try{
            painter.paint(g2d);
            configureSVGGraphics2D(g2d);
            g2d.stream(osw);
            osw.flush();
            bos.flush();
            bos.close();
        }catch(Exception e){
            StringWriter trace = new StringWriter();
View Full Code Here

        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        OutputStreamWriter osw = new OutputStreamWriter(bos, "UTF-8");
        try{
            painter.paint(g2d);
            configureSVGGraphics2D(g2d);
            g2d.stream(osw);
            osw.flush();
            bos.flush();
            bos.close();
        }catch(Exception e){
            StringWriter trace = new StringWriter();
View Full Code Here

    // Output the resulting document to the output transcoder.
    try {
      OutputStream os = output.getOutputStream();
      if (os != null) {
        svgGenerator.stream(svgGenerator.getRoot(), new OutputStreamWriter(os), false, false);
        return;
      }

      // Writer
      Writer wr = output.getWriter();
View Full Code Here

      }

      // Writer
      Writer wr = output.getWriter();
      if (wr != null) {
        svgGenerator.stream(svgGenerator.getRoot(), wr, false, false);
        return;
      }

      // URI
      String outputuri = output.getURI();
View Full Code Here

      if ( outputuri != null ){
        try{
          URL url = new URL(outputuri);
          URLConnection urlCnx = url.openConnection();
          os = urlCnx.getOutputStream();
          svgGenerator.stream(svgGenerator.getRoot(), new OutputStreamWriter(os), false, false);
          return;
        } catch (MalformedURLException e){
          handler.fatalError(new TranscoderException(e));
        } catch (IOException e){
          handler.fatalError(new TranscoderException(e));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.