Skip to content

Instantly share code, notes, and snippets.

@aspose-cloud
Last active September 10, 2021 20:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aspose-cloud/bdc9bff9bdd003c62760f22e2ecfd452 to your computer and use it in GitHub Desktop.
Save aspose-cloud/bdc9bff9bdd003c62760f22e2ecfd452 to your computer and use it in GitHub Desktop.
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