Reads an SVG and rasterises it into an ordinary CFML image object, so the whole image* family (resize, crop, draw on, imageWrite to png/jpg/gif) applies to it. source is either a path to an .svg file or the SVG markup itself (strings containing
Read an SVG at native size and write it as a PNG.
img = imageReadSvg(expandPath("/logo.svg"));
imageWrite(img, expandPath("/logo.png"));
Rasterise inline SVG markup into a 200x100 box.
svg = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"400\" height=\"200\"><rect width=\"400\" height=\"200\" fill=\"red\"/></svg>";
img = imageReadSvg(svg, 200, 100);
writeDump(imageInfo(img));
Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.