We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

System.InvalidCastException when trying to export VSDX to PNG

I get an exeption when I try to export an VSDX file to PNG.

Here is my code example:
ExampleAsposeDiagramRequest9.zip (2.4 MB)


We have logged an issue as DIAGRAMNET-52090 in our issue tracking system for the sake of correction. We will look into its details and keep you posted with the status of its correction. Please be patient and spare us some time.

We are sorry for the inconvenience.


Can you please try using the below code snippet and let us know in case you still face any issue:

Aspose.Diagram.Saving.ImageSaveOptions imgSaveOptions = new Aspose.Diagram.Saving.ImageSaveOptions(SaveFileFormat.PNG);
diagram.Save("52090.png", imgSaveOptions);
But not using SVGSaveOptions to save to png
var opt = new SVGSaveOptions() { };
opt.SaveFormat = Aspose.Diagram.SaveFileFormat.Png;
diagram.Save("Drawing.png", opt);

@asad.ali It works with that solution now. Thanks for your help!