0

Is there an application to convert a svg drawing to Java's Path2d?

Is this method more efficient than using any SVG to Java toolkit? (with efficiency i refer to runtime speed).

Thanks.

Gabriel
  • 5,453
  • 14
  • 63
  • 92
  • 2
    SVG drawings can be a lot more complex than `Path2D` objects. Those objects don't even represent color. And we're not even talking about line-style, fill-style, effects, ... here. – Joachim Sauer Mar 01 '10 at 16:21
  • You can define all those values, color, line style, etc. I'm sure you knew that. But what i think you meant is that those parameters are not included in the Path2D, only the shape vectors. – Gabriel Mar 01 '10 at 16:31

1 Answers1

5

If you just want to convert SVG path syntax to an AWT path object, you can use Batik's PathParser class in conjunction with an AWTPathProducer. That will generate an ExtendedGeneralPath, which isn't a Path2D but it does implement Shape.

heycam
  • 2,188
  • 15
  • 19