does anyone know of a tool that can take an SVG file, and convert it into an HTML 5 SVG path? you know, the
d="M 0 0 L 20 134 L 233 24 Z" fill="#99dd79"part?
But not sure. Does this mean Illustrator can take any line drwaing and save it as an SVG path?
Yes there is inkscape, but I’m looking for gradient and masking support, if that’s possible. I’d like to be able to utilize .ai files and export them using illustrator or Acrobat or something… is there something out there? Or is it built in to Illustrator or Acrobat as an output format?
Gimp can be used to convert SVGs with primitives (e.g. rects, circles, etc.) into a single path which can be used within HTML5.
- First download Gimp: https://www.gimp.org/downloads/
- Export your SVG as a
.svgfile with any tool of choice e.g. Illustrator. Don’t worry if the SVG output is messy for now, Gimp will clean it up
- Import the SVG file into Gimp with File -> Open, and the following (or similar) dialog should show up:
Check both the Import Paths and Merge imported paths options
- Then go to Windows->Dockable Dialogues->Paths
- Right-click on the single path which says Imported Path and you should see the following dialog:
- Click Export Path… and save this text file to a location of your choice
- Locate and open up this file with a text editor of your choice e.g Notepad, TextEdit
- Copy the text within the
<path d="copy this text here" />
- Since Gimp formats the text with lots of spaces, you may need to re-format it, by removing some of the spaces to paste it into your HTML in a single line