We are using the component to convert aprox. 60.000 Visio diagrams into the SVG format on a regular basis. We then use the SVG files as part of the content in a wide range of software and hardware products.
Unfortunately, some of the hardware products uses a proprietary SVG viewer which is not 100% compatible with the SVG standard.
We would like to have filled rectangles using rectangle elements instead of path element.
Would you please share respective source VISIO Diagram and sample code snippet with us. We will test the scenario in our environment and address it accordingly.
I am a developer of Thomas’, and I have developed the program.
Here are the svg and the visio file --> rectangles.zip (128.4 KB)
The code in question is:
var d = new Diagram(input);
var SVGso = new SVGSaveOptions();
SVGso.ExportGuideShapes = false;
SVGso.SaveFormat = SaveFileFormat.SVG;
SVGso.SVGFitToViewPort = true;
d.Save(svgoutname, SVGso);
We have observed the issue that you have mentioned and logged a feature request as DIAGRAMNET-51597 in our issue tracking system. We will further look into details of the feature request and keep you posted with the status of ticket resolution. Please be patient and spare us little time.
It would appear that not all path elements are correctly exported as rect elements.
The code is still as follows:
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);
path.zip (402.1 KB) contains a Visio file, and 4 SVG’s prefixed with the Aspose version (19.1- 19.4) In all version only some of the path elements is converted to rect elements.
We have logged your concerns under a separate ticket i.e. DIAGRAMNET-51636 for further investigation. We will let you know as soon as some definite updates are available regarding ticket resolution. Please spare us little time.
The flag SVGso.ExportElementAsRectTag defines whether exporting filled rectangle elements as rect tag or not. But not all paths to rect tag. Could you please share some screenshot or example of the issue for better understanding.
When the path is simply a rectangle, we will export it as rect tag. It is not related to filled style. Furthermore, we have fixed the issue of line 585 in output SVG in Aspose.Diagram for .NET 19.5 which will be available in current or next week of this month.
I have been investigating this a bit further. And it would appear that Visio saves the rectangle information as it can “correctly” export rectangles as rect tags. So my guess is that the information is there, and perhaps it isn’t even possible for you to read that information. But it would be nice if you could try
I have attached a simple visio, with rectangles in different sizes, and some non-rectangles, including a circle…(which isn’t generated as an ellipse tag either -> creating a new issue for that)
I hope you can get the information about the rectangles from the visio file, to generate the rect tags “correctly”.