We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Convert Shapes and path to polylines

Hello,

I have a question. Is there a way to convert the shapes and path of a SVG file to polylines with the API ?
Or a way to compute the total length and a point at a specific length (equivalent of getTotalLength and getPointAtLength in JS) ?

Else, is there a way to convert basic shapes to path with the API?
Thanks by advance

Jordane

@jaucagne

We are getting related details and will share our feedback shortly.

Ok thanks @asad.ali ,

To explain the goal of the my question, we needs for our business to transform the shapes and path elements of a SVG file to several polylines (arrays of points) to construct a file containing all points use to display the drawing represented in the SVG file.

@jaucagne

An investigation ticket as SVGNET-83 has been logged in our issue tracking for analysis against your requirements. We will further look into ticket details and let you know as soon as it is resolved. Please be patient and spare us some time.

We are sorry for the inconvenience.

@jaucagne

I have a question. Is there a way to convert the shapes and path of a SVG file to polylines with the API ?
We have a special interface ISVGAnimatedPathData (https://reference.aspose.com/svg/net/aspose.svg.paths/isvganimatedpathdata/) that can be used to get the internal representation of SVGPath element as a list of path segments, but there is no way to work with shapes in such manner. But we can share on public a special method “public virtaul SVGPathSegList EquivalentPath()” for the class SVGGeometryElement and in this case you will be able get segments list for any shape too.

Or a way to compute the total length and a point at a specific length (equivalent of getTotalLength and getPointAtLength in JS) ?
Yes, we have such methods in the class SVGGeometryElement (GetTotalLength, GetPointAtLength, etc…) (https://reference.aspose.com/html/java/com.aspose.html.dom.svg/svggeometryelement) and they should work too.

Else, is there a way to convert basic shapes to path with the API?
Not currently, but as said above, we can make the EquivalentPath() method public for SVG shapes and paths. We can add this functionality into the June release.

To explain the goal of the my question, we needs for our business to transform the shapes and path elements of a SVG file to several polylines (arrays of points) to construct a file containing all points use to display the drawing represented in the SVG file.
W think working with SVGPathSeg elements, you can extract segment type, points and etc.