SVG rendering

Does anyone have a working solution to render SVGs into a Picture object or PNGs?

I already tried GraphicsMagick from MBS (unfortunately makes straight lines out of curves) and this module (unfortunately also faulty rendering):

Thanks

It would be helpful to know what’s failing about zoclee so perhaps someone could fix it.

1 Like

Well, it seems to be the same problem as was already reported by @Thom_McGrath in 2017.

Maybe you can find this OpenSource project useful for that: GitHub - lbmonsalve/Xojo-SVGDocument: Load and create SVG documents in Xojo, you can render to Group2D or Picture.

Thanks, this is working great so far.
Do you have any ideas how to remove white / black fill color of closed curves?
Or the X and Y offset if the curves don’t start at X = 0 / Y = 0?

See sample project and test.svg / test2.svg:
https://drive.google.com/file/d/1w0cZRazOZW1lZXXNPGhLrLR1pKzPmdEN/view?usp=sharing

Thanks

Unfortunately it also doesn’t work well with more complex .svg files.
See here the output of the library on the left and how the logo should look like on the right (Affinity Designer):

Do you have to use svg files? pdf works out of the box.

SVG files are often used for print and cut, and may work better than PDF in many apps used for such purposes.

I have to read svg files and render them to several pngs with different sizes.

Many years ago I wrote a SVG converter, that will convert them to PDF so they can be used in Mac applications.

I guess @Bernardo_Monsalve could take a look at that. He is the developer of the library.