Free Support Forum - aspose.com

Save vsdx to svg format it shown exception

@asad.ali,

While saving the ‘. VSDX’ file to '. SVG it will show the exception like below.

Aspose.Diagram.DiagramException: ImageSaveOptions save format can be TIFF, PNG, BMP, EMF or JPEG only.

Sample Code:

                string[] files = Directory.GetFiles(strInputPath, "*.vsdx");
		foreach(string strFile in files)
		{
			Diagram vdxDiagram = new Diagram(strFile);
			vdxDiagram.RemoveHiddenInformation((int) (RemoveHiddenInfoItem.Masters | RemoveHiddenInfoItem.PersonalInfo | RemoveHiddenInfoItem.Shapes | RemoveHiddenInfoItem.Styles));
			ImageSaveOptions opt = new ImageSaveOptions(SaveFileFormat.SVG)
			                       {
				                       SmoothingMode = SmoothingMode.HighQuality,
				                       CompositingQuality = CompositingQuality.HighQuality,
				                       InterpolationMode = InterpolationMode.HighQualityBicubic,
				                       PixelOffsetMode = PixelOffsetMode.HighQuality
			                       };
			vdxDiagram.Save(strOutputPath + Path.GetFileNameWithoutExtension(strFile)+".svg", opt);
		}

Visio File: Background_Missing_Old.zip (100.3 KB)

Please support us,

Thanks

@msindia

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

We are sorry for the inconvenience.

@asad.ali,

This ticket status still " Won’t Fix"

### Issues Status

**DIAGRAMNET-51685**  ---- Status : Won't Fix

Could you please share the status (Reason).

Thanks

@msindia

Would you please use following code snippet instead of using ImageSaveOptions"

Diagram diagram = new Diagram(strFile);
diagram.Save("output.svg", SaveFileFormat.SVG);

In case you still face any issue, please feel free to let us know.

@asad.ali

Would you please use following code snippet instead of using ImageSaveOptions"

```
Diagram diagram = new Diagram(strFile);
diagram.Save("output.svg", SaveFileFormat.SVG);
```

It’s working fine.

But, Why I can’t use this
ImageSaveOptions opt = new ImageSaveOptions(SaveFileFormat.SVG)

Could please share the reason.

Thanks.

@msindia

We are gathering the details and will get back to you with them shortly.

The issues you have found earlier (filed as DIAGRAMNET-51685) have been fixed in Aspose.Diagram for .NET 19.9.

@asad.ali

You’re awesome :slightly_smiling_face:, the ticket **’ DIAGRAMNET-51685’
is solved.

Thanks for your support, :muscle:

Thanks.

@asad.ali,

While saving the ‘. VSDX’ file to ‘. SVG’ format. Some extra icon shown.

Input: Unwanted_Icon Shown.zip (54.0 KB)
Output: Unwanted_Icon Shown (2).zip (5.2 KB)

have a look below image:

UnwantedIcon.png (8.1 KB)

Please help us.

Thanks

@msindia

Would you kindly share the code snippet that you are using. We will test the scenario in our environment and address it accordingly.

@asad.ali,

We have tried with below code,

string strInputPath = @“C:\vj\2019\Visio Issues\Old”;
string strOutputPath = @“C:\vj\2019\Visio Issues\New\SVG”;

  	string[] files = Directory.GetFiles(strInputPath, "*.vsdx");

  	// Act

  	foreach(string strFile in files)
  	{
  		Diagram vdxDiagram = new Diagram(strFile);
  		//vdxDiagram.RemoveHiddenInformation((int) (RemoveHiddenInfoItem.Masters | RemoveHiddenInfoItem.PersonalInfo | RemoveHiddenInfoItem.Shapes | RemoveHiddenInfoItem.Styles));
  		ImageSaveOptions opt = new ImageSaveOptions(SaveFileFormat.SVG)
  		                       {
  			                       SmoothingMode = SmoothingMode.HighQuality,
  			                       CompositingQuality = CompositingQuality.HighQuality,
  			                       InterpolationMode = InterpolationMode.HighQualityBicubic,
  			                       PixelOffsetMode = PixelOffsetMode.HighQuality
  		                       };
  		vdxDiagram.Save(strOutputPath + Path.GetFileNameWithoutExtension(strFile) + ".svg", opt);
  	}

Thanks.

@msindia

Thanks for sharing the code snippet.

We have logged an issue as DIAGRAMNET-51720 in our issue tracking system for the sake of correction. We will surely inform you as soon as the issue is rectified. Please spare us little time.

We are sorry for the inconvenience.

The issues you have found earlier (filed as DIAGRAMNET-51720) have been fixed in Aspose.Diagram for .NET 19.10.

@asad.ali
You’re awesome :slightly_smiling_face:, the ticket **’ DIAGRAMNET-51720
is solved.

Thanks for your support, :muscle:

Thanks.