Filled rectangles using rectangle elements instead of path element

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.

Current output
<path…>

Expected output
<rect…>

@Thomas_Knudsen

Thanks for contacting support.

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);

@hellagutmanndk

Thanks for providing requested details.

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.

We are sorry for the inconvenience.

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

Hi

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.

@hellagutmanndk

Thanks for your feedback.

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.

We are sorry for the inconvenience.

@hellagutmanndk

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.

Hi again, Yeah i see that this is the case. However what constitutes a filled rectangle? Does it have a fill=none or something else?

if the rule is fill=none => path element, then why is this path element then not a rect element?

<path d=‘M0,0.425196856 L0.396850407,0 L0.396850407,0 L0,0.425196856 Z’ stroke=’#000000’ stroke-width=‘0.24’ stroke-linecap=‘round’ stroke-linejoin=‘round’ fill=’#FFFFFF’ fill-rule=‘evenodd’ />

(line 585 in the 19.1 version of the svg)

@hellagutmanndk

We are investigating the scenario and will get back to you soon.

what is soon? :wink:

@hellagutmanndk

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.

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

Hi again

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 :slight_smile:

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”.

rectangles.zip (60.4 KB)

@hellagutmanndk

Thanks for sharing your feedback.

We have recorded these details along with the ticket and will surely inform you as soon as some updates are available.

We will surely be testing and addressing that issue in respective thread.

Have you had a chance to look deeper into this?

@hellagutmanndk

Would you kindly test the scenario using Aspose.Diagram for .NET 19.8. In case you still notice any issue, please feel free to let us know.