public void handleOption(String optionValue, SVGConverter c){ c.setDst(new File(optionValue)); } public String getOptionDescription(){
public void handleOption(String optionValue, SVGConverter c){ c.setDst(new File(optionValue)); } public String getOptionDescription(){
public void handleOption(String optionValue, SVGConverter c){ c.setDst(new File(optionValue)); } public String getOptionDescription(){
public byte[] getSVGImage(int hashCode, String content, String extension, int height, int width) throws IOException, SVGConverterException { File dfile = getTempFile(hashCode, "svg"); if (!dfile.exists()) { FileWriter fwriter = new FileWriter(dfile); fwriter.write(content); fwriter.flush(); fwriter.close(); } File ofile = getTempFile(hashCode, extension); //TODO implement conversion HERE SVGConverter conv = new SVGConverter(); // TODO PNG ONLY conv.setDestinationType(DestinationType.PNG); conv.setDst(ofile); conv.setHeight(height); conv.setWidth(width); String[] sources = {dfile.getAbsolutePath()}; conv.setSources(sources); conv.execute(); FileInputStream fis = new FileInputStream(ofile); byte[] result = new byte[(int)ofile.length()]; fis.read(result); return result; }