Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
This Gist contains code snippets related to Converting VSD to SVG format using C# .NET
// Get ClientID from https://dashboard.aspose.cloud/
string clientSecret = "caac6e3d4a4724b2feb53f4e460eade3";
string clientID = "4ccf1790-accc-41e9-8d18-a78dbb2ed1aa";
// create an object of DiagramApi
DiagramApi diagramApi = new DiagramApi("client_credentials", clientID, clientSecret);
// source VSD file available in Cloud storage
String inputFile = "Raise-PO-Process-Flow-Chart.vsd";
// resultant SVG file name
String resultant = "conveted.svg";
try
{
// initiate the file conversion process
var response = diagramApi.DownloadFileWithFormat(inputFile,format: "SVG", null);
if (response != null )
{
Console.WriteLine("Successfully converted VSD to SVG !");
}
// custom method to save resultant file on local system drive
saveToDisk(response, "/Users/nshahbaz/Downloads/" + resultant);
}
catch (Exception ex)
{
Console.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
public static void saveToDisk(Stream responseStream, String resultantFile)
{
var fileStream = File.Create(resultantFile);
responseStream.Seek(0, SeekOrigin.Begin);
responseStream.CopyTo(fileStream);
fileStream.Close();
}
This Gist contains code snippets related to Converting VSD to SVG format using C# .NET
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment