Hi
The attached visio file is throwing an Unable to cast object of type ' ’ to type ' ’ while trying to convert it to SVG using the following snippet
var d = new Diagram(file);
var SVGso = new SVGSaveOptions();
SVGso.ExportGuideShapes = false;
SVGso.SaveFormat = SaveFileFormat.SVG;
SVGso.SVGFitToViewPort = true;
SVGso.ExportElementAsRectTag = true;
d.Save(svgoutname, SVGso);
We are also converting it to PDF, GIF and PNG, but either of these formats have been testet yet at our process halt when either of the 4 formats fails to convert.
PDF is just saved with
d.Save(pdfoutname, SaveFileFormat.PDF)
GIF and PNG are saved with (the format is changed for PNG output - ofcourse)
var so = new ImageSaveOptions(SaveFileFormat.GIF);
so.CompositingQuality = CompositingQuality.HighQuality;
so.InterpolationMode = InterpolationMode.HighQualityBicubic;
d.Save(outputname, so);
Using Apose.Diagrams 19.3.0
object cast exception.zip (327.4 KB)