Examples of SVGTranscoder


Examples of org.apache.batik.transcoder.svg2svg.SVGTranscoder

        }

        svgRoot.setAttributeNS(null, "width", "" + (totalWidth + 1));
        svgRoot.setAttributeNS(null, "height", "" + (totalHeight + 1));
        //svgRoot.setAttributeNS(null, "viewBox", "0 0 " + pageWidth + " " + pageHeight);
        SVGTranscoder svgT = new SVGTranscoder();
        TranscoderInput input = new TranscoderInput(svgDocument);
        TranscoderOutput output =
          new TranscoderOutput(new OutputStreamWriter(ostream));
        try {
            svgT.transcode(input, output);
        } catch (TranscoderException e) {
            log.error("could not write svg file :" + e.getMessage(), e);
        }
        ostream.flush();
        ostream = null;
View Full Code Here

Examples of org.apache.batik.transcoder.svg2svg.SVGTranscoder

    /**
     * {@inheritDoc}
     */
    public void writeSvgDocument(final SVGDocument svgDocument,
            final OutputStream outputStream) {
        final SVGTranscoder svgT = new SVGTranscoder();
        final TranscoderInput input = new TranscoderInput(svgDocument);
        final OutputStreamWriter osw = new OutputStreamWriter(outputStream);
        final TranscoderOutput output = new TranscoderOutput(osw);
        try {
            svgT.transcode(input, output);
        } catch (final TranscoderException e) {
            getLogger().error("could not write svg file :" + e.getMessage());
            getLogger().error(e.getMessage());
        }
    }
View Full Code Here

Examples of org.apache.batik.transcoder.svg2svg.SVGTranscoder

                                     "xml:base",
                                     svgDoc.getURL());
                            }

                            if (prettyPrint) {
                                SVGTranscoder trans = new SVGTranscoder();
                                trans.transcode(new TranscoderInput(svgDoc),
                                                new TranscoderOutput(writer));
                            } else {
                                DOMUtilities.writeDocument(svgDoc, writer);
                            }
View Full Code Here

Examples of org.apache.batik.transcoder.svg2svg.SVGTranscoder

        }

        svgRoot.setAttributeNS(null, "width", "" + (totalWidth + 1));
        svgRoot.setAttributeNS(null, "height", "" + (totalHeight + 1));
        //svgRoot.setAttributeNS(null, "viewBox", "0 0 " + pageWidth + " " + pageHeight);
        SVGTranscoder svgT = new SVGTranscoder();
        TranscoderInput input = new TranscoderInput(svgDocument);
        TranscoderOutput output =
          new TranscoderOutput(new OutputStreamWriter(ostream));
        try {
            svgT.transcode(input, output);
        } catch (TranscoderException e) {
            log.error("could not write svg file :" + e.getMessage(), e);
        }
        ostream.flush();
        ostream = null;
View Full Code Here

Examples of org.apache.batik.transcoder.svg2svg.SVGTranscoder

        try {
            controller.render(target, workspace);

            // creates SVG-to-SVG transcoder
            SVGTranscoder t = new SVGTranscoder();
            t.addTranscodingHint(SVGTranscoder.KEY_XML_DECLARATION, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>");

            // sets transcoder input and output
            TranscoderInput input = new TranscoderInput(target.getDocument());

            // performs transcoding
            try {
                TranscoderOutput output = new TranscoderOutput(writer);
                t.transcode(input, output);
            } finally {
                writer.close();
                props.removeSimpleValue(PreviewProperty.MARGIN);
            }
        } catch (Exception e) {
View Full Code Here

Examples of org.apache.batik.transcoder.svg2svg.SVGTranscoder

        }

        svgRoot.setAttributeNS(null, "width", "" + (totalWidth + 1));
        svgRoot.setAttributeNS(null, "height", "" + (totalHeight + 1));
        //svgRoot.setAttributeNS(null, "viewBox", "0 0 " + pageWidth + " " + pageHeight);
        SVGTranscoder svgT = new SVGTranscoder();
        TranscoderInput input = new TranscoderInput(svgDocument);
        TranscoderOutput output =
          new TranscoderOutput(new OutputStreamWriter(ostream));
        try {
            svgT.transcode(input, output);
        } catch (TranscoderException e) {
            log.error("could not write svg file :" + e.getMessage(), e);
        }
        ostream.flush();
        ostream = null;
View Full Code Here

Examples of org.apache.batik.transcoder.svg2svg.SVGTranscoder

      transcoder = imageTranscoder;
    }
    else if (imageType == SupportedImageTypes.SVG)
    {
      transcoder = new SVGTranscoder();
    }

    return transcoder;
  }
View Full Code Here

Examples of org.apache.flex.forks.batik.transcoder.svg2svg.SVGTranscoder

                                     "xml:base",
                                     svgDoc.getURL());
                            }

                            if (prettyPrint) {
                                SVGTranscoder trans = new SVGTranscoder();
                                trans.transcode(new TranscoderInput(svgDoc),
                                                new TranscoderOutput(writer));
                            } else {
                                DOMUtilities.writeDocument(svgDoc, writer);
                            }
View Full Code Here

Examples of org.pushingpixels.flamingo.api.svg.SvgTranscoder

      try {
        final CountDownLatch latch = new CountDownLatch(1);
        final PrintWriter pw = new PrintWriter(javaClassFilename);

        SvgTranscoder transcoder = new SvgTranscoder(file.toURI()
            .toURL().toString(), svgClassName);
        transcoder.setJavaToImplementResizableIconInterface(false);
        transcoder.setJavaPackageName(args[1]);
        transcoder.setListener(new TranscoderListener() {
          public Writer getWriter() {
            return pw;
          }

          public void finished() {
            latch.countDown();
          }
        });
        transcoder.transcode();
        latch.await();
      } catch (Exception e) {
        e.printStackTrace();
      }
    }
View Full Code Here

Examples of org.pushingpixels.flamingo.api.svg.SvgTranscoder

                + File.separator + svgClassName + ".java";

            final PrintWriter pw = new PrintWriter(
                javaClassFilename);

            SvgTranscoder transcoder = new SvgTranscoder(f.toURI()
                .toURL().toString(), svgClassName);
            transcoder
                .setJavaToImplementResizableIconInterface(true);
            transcoder.setListener(new TranscoderListener() {
              public Writer getWriter() {
                return pw;
              }

              public void finished() {
                JOptionPane.showMessageDialog(null, "Finished");
              }
            });
            transcoder.transcode();

          } catch (IOException ex) {
            ex.printStackTrace();
          }
        }
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.