jsignature c# convert to png

i use below code to download jsignature to svg 64 and it works to me. but how can convert to string to png in c#?



<script src="../Scripts/jquery-3.1.1.min.js"></script>
    <script src="../libs/flashcanvas.js"></script>
    <script src="../libs/jSignature.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#signature").jSignature({ width: 650, height: 250 });
        });
         function GetData() {
            var $sigdiv = $("#signature");
            var datapair = $sigdiv.jSignature("getData", "svgbase64")
            var image = document.getElementById("Image1");
            image.src = "data:" + datapair[0] + "," + datapair[1]
               }
    </script>

   <div id="signature"></div>
          <input id="Button2" type="button" value="GetData" onclick="GetData()" />
        <hr />

        <asp:Image ID="Image1" runat="server" />

Open in new window

LVL 1
ITsolutionWizardAsked:
Who is Participating?
 
MishaProgrammerCommented:
Try this code:
public void ProcessRequest(HttpContext context)
{
 context.Response.ContentType = "image/png";
 
 String svgXml = GetSvgImageXml(context);
 string svgFileName = GetSvgFileName(context);
 using (StreamWriter writer = new StreamWriter(svgFileName, false))
 {
  writer.Write(svgXml);
 }

 string pngFileName = GetPngFileName(context);

 string inkscapeArgs = 
  "-f " + svgFileName + " -e \"" +
  context.Server.MapPath(PngRelativeDirectory) + "\\" +
  pngFileName + "\"";

 Process inkscape = Process.Start(
   new ProcessStartInfo(
    "C:\\program files\\inkscape\\inkscape.exe",
    inkscapeArgs));
 inkscape.WaitForExit(3000);
 context.Server.Transfer(PngRelativeDirectory + pngFileName);
}

Open in new window


And you can lock on these links:
SVG
SVG2
0
 
ITsolutionWizardAuthor Commented:
Any helps!?
0
 
MishaProgrammerCommented:
Please, specify what do you want to convert? what type and what value?
0
 
ITsolutionWizardAuthor Commented:
Convert from svg 64 to png
0
 
MishaProgrammerCommented:
There is no activity from author
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.