Free Support Forum - aspose.com

Filled rectangles using rectangle elements instead of path element


#1

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…>


#2

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


#3

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


#4

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


#5

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


#6

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.


#7

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


#8

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


#9

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)


#10

@hellagutmanndk

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


#11

what is soon? :wink:


#12

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


#13

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