SVGtoPNG
var response = getPageContext().getFusionContext().getResponse();
response.setContentType( 'image/png' );
var content = fileread( expandPath( "./handlers/test.svg" ) );
var inputStream = createObject("java", "java.io.StringBufferInputStream").init( content );
var input = createObject( "java", "org.apache.batik.transcoder.TranscoderInput").init(inputStream);
var outputStream = response.getOutputStream();;
var output = createObject( "java", "org.apache.batik.transcoder.TranscoderOutput").init(outputStream);
This file has been truncated. show original
StackTrace
coldfusion.runtime.java.JavaObjectInstantiationException: Object instantiation exception.
at coldfusion.runtime.java.JavaProxyFactory.getProxy(JavaProxyFactory.java:170)
at coldfusion.runtime.ProxyFactory.getProxy(ProxyFactory.java:65)
at coldfusion.runtime.CFPage.createObjectProxy(CFPage.java:5747)
at coldfusion.runtime.CFPage.CreateObject(CFPage.java:5710)
at coldfusion.runtime.CFPage.CreateObject(CFPage.java:5644)
at coldfusion.runtime.CFPage.CreateObject(CFPage.java:5619)
at coldfusion.runtime.CFPage.CreateObject(CFPage.java:5566)
at cfGeneral2ecfc646371968$funcINDEX.runFunction(/Applications/MAMP/htdocs/gloss_2.0/handlers/General.cfc:32)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)
This file has been truncated. show original
TestSVG
<?xml version="1.0" standalone="yes"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="480px" height="205px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"><defs><linearGradient x1="0" y1="0" x2="6.123031769111886e-17" y2="1" id="gradientGreen"><stop offset="0%" stop-color="#94ae0a" stop-opacity="1"></stop><stop offset="100%" stop-color="#6b7e07" stop-opacity="1"></stop></linearGradient><linearGradient x1="0" y1="0" x2="6.123031769111886e-17" y2="1" id="gradientYellow"><stop offset="0%" stop-color="#9D8D00" stop-opacity="1"></stop><stop offset="100%" stop-color="#FFFF00" stop-opacity="1"></stop></linearGradient><linearGradient x1="0" y1="0" x2="6.123031769111886e-17" y2="1" id="gradientRed"><stop offset="0%" stop-color="#a61120" stop-opacity="1"></stop><stop offset="100%" stop-color="#780c17" stop-opacity="1"></stop></linearGradient></defs><rect width="100%" height="100%" fill="#fff" fill-opacity="0" stroke="none" /><path d="M 135 155 L 125 155 Z" fill="none" stroke="#444" stroke-width="1" z-index="0" transform="matrix(1,0,0,1,0,0)" /><path d="M 155.05321559063054 93.28254850929031 L 146.96304564688106 87.40469598636558 Z" fill="none" stroke="#444" stroke-width="1" z-index="0" transform="matrix(1,0,0,1,0,0)" /><path d="M 207.55321559063054 55.13906578900887 L 204.46304564688106 45.62850062605733 Z" fill="none" stroke="#444" stroke-width="1" z-index="0" transform="matrix(1,0,0,1,0,0)" /><path d="M 272.44678440936946 55.13906578900888 L 275.536954353119 45.628500626057345 Z" fill="none" stroke="#444" stroke-width="1" z-index="0" transform="matrix(1,0,0,1,0,0)" /><path d="M 324.94678440936946 93.28254850929032 L 333.036954353119 87.4046959863656 Z" fill="none" stroke="#444" stroke-width="1" z-index="0" transform="matrix(1,0,0,1,0,0)" /><path d="M 345 155 L 355 155 Z" fill="none" stroke="#444" stroke-width="1" z-index="0" transform="matrix(1,0,0,1,0,0)" /><path d="M 166.5 155L 135 155A 105 105 0 0 1 142.3734689817336 116.34692196810883L 171.66142828721354 127.94284537767618A 73.5 73.5 0 0 0 166.5 155Z" fill="url(#gradientGreen)" stroke-width="0px" z-index="0" transform="matrix(1,0,0,1,0,0)" /><path d="M 171.66142828721354 127.94284537767618L 142.3734689817336 116.34692196810883A 105 105 0 0 1 155.05321559063054 93.28254850929031L 180.53725091344137 111.79778395650322A 73.5 73.5 0 0 0 171.66142828721354 127.94284537767618Z" fill="url(#gradientYellow)" stroke-width="0px" z-index="0" transform="matrix(1,0,0,1,0,0)" /><path d="M 180.53725091344137 111.79778395650322L 155.05321559063054 93.28254850929031A 105 105 0 0 1 345 155L 313.5 155A 73.5 73.5 0 0 0 180.53725091344137 111.79778395650322Z" fill="url(#gradientRed)" stroke-width="0px" z-index="0" transform="matrix(1,0,0,1,0,0)" /><circle cx="240" cy="155" r="5" fill="#000" transform="matrix(1,0,0,1,0,0)" /><path d="M 240 155 C 240 155 324.94678440936946 93.28254850929034 324.94678440936946 93.28254850929034" fill="none" stroke="#000" stroke-width="2" z-index="0" transform="matrix(1,0,0,1,0,0)" /><text x="235" y="102.5" font-size="18" font-family="Arial" fill="#000" transform="matrix(1,0,0,1,0,0)" ><tspan x="235" dy="4.5">20</tspan></text><text x="115" y="147.99999999999997" font-size="12" font-family="Heveltica, sans-serif" text-anchor="middle" fill="#333" transform="matrix(1,0,0,1,0,0)" ><tspan x="115" dy="3">0</tspan></text><text x="138.87287570313157" y="81.52684346344084" font-size="12" font-family="Heveltica, sans-serif" text-anchor="middle" fill="#333" transform="matrix(1,0,0,1,0,0)" ><tspan x="138.87287570313157" dy="3">5</tspan></text><text x="201.37287570313157" y="36.117935463105795" font-size="12" font-family="Heveltica, sans-serif" text-anchor="middle" fill="#333" transform="matrix(1,0,0,1,0,0)" ><tspan x="201.37287570313157" dy="3">10</tspan></text><text x="278.62712429686843" y="36.11793546310581" font-size="12" font-family="Heveltica, sans-serif" text-anchor="middle" fill="#333" transform="matrix(1,0,0,1,0,0)" ><tspan x="278.62712429686843" dy="3">15</tspan></text><text x="341.12712429686843" y="81.52684346344085" font-size="12" font-family="Heveltica, sans-serif" text-anchor="middle" fill="#333" transform="matrix(1,0,0,1,0,0)" ><tspan x="341.12712429686843" dy="3">20</tspan></text><text x="365" y="148" font-size="12" font-family="Heveltica, sans-serif" text-anchor="middle" fill="#333" transform="matrix(1,0,0,1,0,0)" ><tspan x="365" dy="3">25</tspan></text></svg>