Although there is a module called SVG to generate SVG files, I'd probably just use XML::LibXML. The SVG module doesn't seem to gain you much.
Rather than directly trying to generate Adobe Illustrator files, I'd look at converting the SVG file you already created. If you have Adobe Illustrator on the same computer you'll be generating these files, it's capable of importing SVG files and saving them in its native format. If there are a lot, then it can apparently be automated.
An alternative way to do the conversion would be to look at using convertio.co. I haven't tried it myself but it claims to be able to convert between these formats, and it offers an API. Shouldn't be a lot of work using JSON::MaybeXS and HTTP::Tiny to submit your SVG files to their API and receive Adobe Illustrator files.
| [reply] |
Native Illustrator format is sort of "augmented Postscript", see the spec, AFAIK this was last official document for 20+ y.o. version. New features were added of course, but the core and syntax remain the same. Among free tools, both Inkscape (regardless of what they claim on linked page) and sk1 have long dropped support for exporting to ai. Online, here I succeeded with conversion, (while the link which tobyink provided has failed), looks like some old version of sk1 uniconvertor was used on the server, and indeed some very old ai file (version 5, 25+ y.o.) was produced.
Is this necessary at all? For the last 20 years, ai are saved as pdf (file extension doesn't matter), with pdf as "envelope" and "ai" hidden inside as private data. Worth checking -- change extension to ai, will Illustrator silently import the pdf "envelope"? I suspect it might, so receiving side won't even know. Then, experiment a little, which Perl distribution (PDF::API2, etc.) produce cleanest (or just good enough) pdf code for your kind of data (I mean, since PDF is "machingen for machines", source never seen by human eyes, there may be ugly redundancies, etc.). Of course, if consumer is strongly serious about "ai only", this little cheat won't do, no choice but use Adobe (or more expensive) tools.
| [reply] |