Package org.apache.fop.svg

Examples of org.apache.fop.svg.SVGDriver


  return null;
    }

  protected void loadImage() throws FopImageException {
  try {
      SVGDriver driver = new SVGDriver();
      driver.addElementMapping("org.apache.fop.svg.SVGElementMapping");
      driver.addPropertyList("org.apache.fop.svg.SVGPropertyListMapping");
    XMLReader parser = createParser();
      driver.buildSVGTree(parser, new InputSource(this.m_href.toString()));
      doc = driver.getSVGDocument();
  } catch (Exception e) {
      MessageHandler.errorln("ERROR LOADING EXTERNAL SVG: " + e.getMessage());
  }
  }
View Full Code Here


  protected boolean loadImage()
  {
    // parse document and get the size attributes of the svg element
  try {
      // should check the stream contains text data
      SVGDriver driver = new SVGDriver();
      driver.addElementMapping("org.apache.fop.svg.SVGElementMapping");
      driver.addPropertyList("org.apache.fop.svg.SVGPropertyListMapping");
    XMLReader parser = SVGImage.createParser();
      driver.buildSVGTree(parser, new InputSource(this.imageStream));
      SVGDocument doc = driver.getSVGDocument();
      SVGSVGElement svg = doc.getRootElement();
    this.width = (int)svg.getWidth().getBaseVal().getValue() * 1000;
    this.height = (int)svg.getHeight().getBaseVal().getValue() * 1000;
    return true;
  } catch (Exception e) {
View Full Code Here

TOP

Related Classes of org.apache.fop.svg.SVGDriver

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.