

String svgFileName = GetSvgFileName(context)

Public void ProcessRequest(HttpContext context)Ĭ = "image/png" Start inkscape as a process with the correct parameters.This was quite simple, but I'll put the code here for any future Googlers (and there'll be some, there always is. I tried it out, and it was really quick, and the resultant PNG file was indistinguishable (that's a longer word than it sounds) from the original. Inkscape is an open source SVG editor, which I used to create the image template.

I did however, find mention of inkscape's command line interface. The obvious first step is to Google for a free SVG to PNG library, or example code on CodePlex or something, but I couldn't see anything amongst the noise of shareware apps that did conversions through a GUI. I decided not to convert my code to use the System.Drawing to generate PNGs from the database data, as I'd already solved that problem. Time to bite the bullet (whatever that means) and convert the image to PNG. With a BMP, JPEG or PNG image, the context menu has a copy option that just isn't there with SVG, so there's no simple way to get it into PowerPoint. The other problem is that one of the users wants to copy and paste the image into PowerPoint. No biggie, as there's only a few users, and I can tell them to use FireFox (a pragmatic bug fix!). Firstly, although FireFox displays SVG files beautifully, IE just shows the XML. There have been two minor problems so far. These elements are lines and text, positioned according to the data. I've started with the template picture, and added elements based on the data pulled from the database. I initially chose SVG, as it's an XML format, which is easy to manipulate in C#. I've been dynamically generating SVG images for the intranet I'm working on.
