I have made the opposite conversions (SVG to VectorDrawable
) manually or using web tools.
But I am having hard time to do the opposite thing. I have VectorDrawable
but I am not sure how to convert it to SVG and I can find zero online tools to do it.
Does anyone have experience with this and what are the steps or tools to do it?
Steps I follow:
android:pathData
replaced withd
android:fillColor
replaced withfill
A path in the VectorDrawable without
fillColor
isfill="none"
in SVG.android:viewportHeight="24" android:viewportWidth="24"
isviewBox="0 0 24 24"
in SVG.Example
Vector Drawable
SVG
The VectorDrawable format is pretty similar to SVG.
You can find the documentation of the VectorDrawable format here, and the documentation of the SVG format here.
I just written this Python script which converts a vector drawable xml, to a svg. It doesn't cover all the vector drawable proprieties, but it works with the most common ones. You have only to drop your xml files onto the script, and the files will be converted.