Package org.jfree.svg

Class SVGUtils

java.lang.Object
org.jfree.svg.SVGUtils

public class SVGUtils extends Object
Utility methods related to the SVGGraphics2D implementation.
  • Method Details

    • escapeForXML

      public static String escapeForXML(String source)
      Returns a new string where any special characters in the source string have been encoded.
      Parameters:
      source - the source string (null not permitted).
      Returns:
      A new string with special characters escaped for XML.
      Since:
      1.5
    • writeToSVG

      public static void writeToSVG(File file, String svgElement) throws IOException
      Writes a file containing the SVG element.
      Parameters:
      file - the file (null not permitted).
      svgElement - the SVG element (null not permitted).
      Throws:
      IOException - if there is an I/O problem.
      Since:
      1.2
    • writeToSVG

      public static void writeToSVG(File file, String svgElement, boolean zip) throws IOException
      Writes a file containing the SVG element.
      Parameters:
      file - the file (null not permitted).
      svgElement - the SVG element (null not permitted).
      zip - compress the output.
      Throws:
      IOException - if there is an I/O problem.
      Since:
      3.0
    • writeToHTML

      public static void writeToHTML(File file, String title, String svgElement) throws IOException
      Writes an HTML file containing an SVG element.
      Parameters:
      file - the file.
      title - the title.
      svgElement - the SVG element.
      Throws:
      IOException - if there is an I/O problem.