I have a 354 of eps, ai and cdr files that I want to convert to svg. Obviously opening each in Inkscape and then saving them via the guy would take a really long time so I was wondering if anyone had any idea on how to do this via the command line (using Ubuntu 10.10) that would preserve the file names as well?
I've tried doing this using uniconverter but keep getting errors whereas it seems inkscape can handle most of the files I throw at it
How do I do batch conversions?
- hellocatfood
- Posts: 193
- Joined: Fri Aug 29, 2008 8:49 pm
- Contact:
Re: How do I do batch conversions?
I seem to recall that IrfanView does batch conversions, but I don't know about SVG. http://www.irfanview.com/
Basics - Help menu > Tutorials
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
- hellocatfood
- Posts: 193
- Joined: Fri Aug 29, 2008 8:49 pm
- Contact:
Re: How do I do batch conversions?
Thanks, but I'm using Ubuntu so can't really run Irfanview
-
- Posts: 9
- Joined: Thu Jan 27, 2011 2:52 am
Re: How do I do batch conversions?
Huh, my post disappeared. Well. I'll try again.
Can you use this page? http://inkscape.modevia.com/inkscape-man.html
I am guessing that you can use the flag --export-plain-svg so you'll just need to iterate through your files. I can't help you with that, sorry, but you can probably find something on google.
Can you use this page? http://inkscape.modevia.com/inkscape-man.html
I am guessing that you can use the flag --export-plain-svg so you'll just need to iterate through your files. I can't help you with that, sorry, but you can probably find something on google.
- hellocatfood
- Posts: 193
- Joined: Fri Aug 29, 2008 8:49 pm
- Contact:
Re: How do I do batch conversions?
After a lot of searching I eventually had to use lots of different software for each file type. None of them could correctly convert the files, but did a good job most of the time.
For ai files you can use the command line
For cdr files you have to use uniconvertor (unless someone can tell me how you'd do this using Ghostscript)
For eps files Ghostscript gave me the best results, though for svgs with embedded images it tries to trace them, leading to huge file sizes (biggest I got was 223Mb)
If you put these into a loop you can do a batch conversion pretty quickly. I put this into a file called conversion.sh to convert eps files:
Hope this helps someone!
For ai files you can use the command line
Code: Select all
inkscape -f infile.ai outfile.svg
For cdr files you have to use uniconvertor (unless someone can tell me how you'd do this using Ghostscript)
Code: Select all
uniconvertor infile.cdr outfile.svg
For eps files Ghostscript gave me the best results, though for svgs with embedded images it tries to trace them, leading to huge file sizes (biggest I got was 223Mb)
Code: Select all
gs -dEPSFitPage -sDEVICE=svg -sOutputFile=outfile.svg infile.eps quit.ps;
If you put these into a loop you can do a batch conversion pretty quickly. I put this into a file called conversion.sh to convert eps files:
Code: Select all
#!/bin/sh
for file in *.eps
do
gs -dEPSFitPage -sDEVICE=svg -sOutputFile=$file.svg "$file" quit.ps;
done
Hope this helps someone!
Re: How do I do batch conversions?
Wow, nice work hellocatfood! 

Basics - Help menu > Tutorials
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
-
- Posts: 1
- Joined: Thu Oct 03, 2013 7:54 pm
Re: How do I do batch conversions?
The above mentioned method for converting AI files didn't work very well for me. The files were converted,but were very huge and out of the page. I ended up using two other tools:
The results were fine then.
The results were fine then.
Re: How do I do batch conversions?
Found this post thru google search. I have 407 eps files (created in old version of Adobe Illustrator) to convert to svg files. I found the ghostscript comes with Ubuntu (described above) does not work. So, I tried to use Inkscape command line method. The Inkscape 0.9.23 in Ubuntu 18.04 can import eps files (use apt-get install instead snap install), but there is no command line option to save it as an Inkscape svg. There is an option to save the eps file as plain svg file, which is good enough for my purpose.
Here is the command line to convert one file
inkscape --file=filename.eps --export-plain-svg=filename.svg
The bash script to convert all files in a directory is
#!/bin/sh
#~/Sign_work/eps2svg/eps2svg.sh
# eps2svg.sh file
# the idea comes from a post at this link
# viewtopic.php?t=8374
for file in *.eps
do
inkscape --file="$file" --export-plain-svg="$file".svg
done
It takes about 10 minutes to convert all 407 eps files. I wish someone may find this information useful.
Here is the command line to convert one file
inkscape --file=filename.eps --export-plain-svg=filename.svg
The bash script to convert all files in a directory is
#!/bin/sh
#~/Sign_work/eps2svg/eps2svg.sh
# eps2svg.sh file
# the idea comes from a post at this link
# viewtopic.php?t=8374
for file in *.eps
do
inkscape --file="$file" --export-plain-svg="$file".svg
done
It takes about 10 minutes to convert all 407 eps files. I wish someone may find this information useful.
Re: How do I do batch conversions?
In the next major version, there's going to be an option to export as inkscape svg: http://wiki.inkscape.org/wiki/index.php ... mmand_Line (not available yet).
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!
Inkscape FAQ - Learning Resources - Website with tutorials (German and English)
Inkscape FAQ - Learning Resources - Website with tutorials (German and English)