Package org.apache.batik.svggen

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


    root.setAttributeNS(null, "viewBox", "0 0 " + viewboxWidth + " "
        + viewboxHeight);
    // Finally, stream out SVG
    // character to byte encoding
    SVGContentImage svgImage = new SVGContentImage();
    svgGenerator.stream(root, svgImage.getWriter(), config.getVisibility()
        .isUseCSS(), false);
    return svgImage;
  }

 
View Full Code Here


    }

    try
    {
      StringWriter swriter = new StringWriter();
      grx.stream(swriter);
      return new BatikRenderer(swriter.getBuffer().toString(), areaHyperlinks);
    }
    catch (SVGGraphics2DIOException e)
    {
      throw new JRRuntimeException(e);
View Full Code Here

      //httpServletResponse.setHeader("Content-Disposition","attachment; filename=\"" + requestedFile + "\"");
          Writer out = new OutputStreamWriter(System.out, "UTF-8");

          //Create an instance of the SVG Generator.
          SVGGraphics2D svgGenerator = new SVGGraphics2D(doc);
          svgGenerator.stream(out, useCSS);
         

    } catch (Exception er) {
      log.error("ERROR ", er);
      System.out.println("Error exporting: " + er);
View Full Code Here

              //OutputStream out = httpServletResponse.getOutputStream();
          //httpServletResponse.setContentType("APPLICATION/OCTET-STREAM");
          //httpServletResponse.setHeader("Content-Disposition","attachment; filename=\"" + requestedFile + "\"");
              Writer out = httpServletResponse.getWriter();
             
              svgGenerator.stream(out, useCSS);
             
             
            } else if (exportType.equals("png") || exportType.equals("jpg")
                || exportType.equals("gif") || exportType.equals("tif")
                || exportType.equals("pdf")){
View Full Code Here

              log.debug("resultFile: "+resultFile.getAbsolutePath());
              log.debug("svgFile P: "+svgFile.getPath());
              log.debug("resultFile P: "+resultFile.getPath());
             
              FileWriter out = new FileWriter(svgFile);
              svgGenerator.stream(out, useCSS);
             
              HashMap<String,Object> returnError = GenerateImage.getInstance().convertImageByTypeAndSize(
                  svgFile.getAbsolutePath(), resultFile.getAbsolutePath(),
                  pBean.getWidth(), pBean.getHeight());
             
View Full Code Here

        }

        log.debug("Write File To: " + firstImageName);

    FileWriter fileWriter = new FileWriter(firstImageName);
    svgGenerator.stream(fileWriter, useCSS);
   
    RecordingConversionJob recordingConversionJobToStore = RecordingConversionJobDaoImpl.getInstance().getRecordingConversionJobsByRecordingConversionJobsId(
        recordingConversionJob.getRecordingConversionJobId());

    recordingConversionJobToStore.setEndTimeInMilliSeconds(recordingConversionJob.getEndTimeInMilliSeconds() + numberOfMilliseconds);
View Full Code Here

        }

        log.debug("Write File To: " + firstImageName);

    FileWriter fileWriter = new FileWriter(firstImageName);
    svgGenerator.stream(fileWriter, useCSS);
   
    RecordingConversionJob recordingConversionJobToStore = RecordingConversionJobDaoImpl.getInstance().getRecordingConversionJobsByRecordingConversionJobsId(
        recordingConversionJob.getRecordingConversionJobId());

    recordingConversionJobToStore.setEndTimeInMilliSeconds(recordingConversionJob.getEndTimeInMilliSeconds() + numberOfMilliseconds);
View Full Code Here

            boolean useCSS = true; // we want to use CSS style attribute
            try{
                FileOutputStream fout = new FileOutputStream(tempFile);
                BufferedOutputStream bout = new BufferedOutputStream(fout);
                Writer out = new OutputStreamWriter(bout, "UTF-8");
                svgGenerator.stream(out, useCSS);
                bout.flush();
                bout.close();
                fout.close();
            }
            catch (IOException e){
View Full Code Here

                                /*
                                 * don't use css, FF3 can'd deal with the result
                                 * perfectly: wrong font sizes
                                 */
                                boolean useCSS = false;
                                svgGenerator.stream(el, out, useCSS, false);
                                outputStream.flush();
                                outputStream.close();
                                bytestream = new ByteArrayInputStream(
                                        baoutputStream.toByteArray());
                            } catch (UnsupportedEncodingException e) {
View Full Code Here

        Painter painter = new BasicShapes();
        painter.paint(g2d);

        StringWriter swA = new StringWriter();
        g2d.stream(g2d.getRoot(), swA);

        // Now, use the getRoot with argument
        domFactory = impl.createDocument(namespaceURI, SVG_SVG_TAG, null);
        ctx = SVGGeneratorContext.createDefault(domFactory);
        ctx.setGraphicContextDefaults(defaults);
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.