Hey, I'm uploading an SVG file, parsing the XML and then using PHP to redraw the image using the GD library. The SVG files are made with CorelDraw.

Everything is going well, I can get the picture height, width, text and images. Just one thing I'm not sure about. Shapes are drawn in the CorelDraw file like:

<path class="fil0" d="M91.8794 25.2618c-6.0627,-5.1126 -17.562,-9.782 -39.3483,-8.2617 -33.3529,2.3277 -37.8551,-13.4169 -38.3175,-20.1526l77.6658 0 0 28.4143z"/>

How do I use this information to recreate this shape using the draw functions? Would it be a imagepolygon or imagearc? Is there another function I should be using? Also, what are attributes that are being required by path?

Thanks,

Ian

Thanks for your reply.

What I'm interested in is how do I draw those curves using the GD library? How can I redraw

<path d="M250 150 L150 350 L350 350 Z" />

using PHP?

I think you have to split them up and use imageline.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.