public string ToPng(string puml, string pngFileName) { string encString = Encoder.EncodeUrl(puml); WebRenderer r = new WebRenderer(); var bytes = r.Render(encString); File.WriteAllBytes(pngFileName, bytes); return(pngFileName); }
public string ToPng(C4DocumentBase doc, string outputFolder) { string imageFileName = Path.ChangeExtension(Path.Combine(outputFolder, doc.Name), ".png"); string encString = Encoder.EncodeUrl(doc.ToString()); WebRenderer r = new WebRenderer(); var bytes = r.Render(encString); File.WriteAllBytes(imageFileName, bytes); return(imageFileName); }