How do I do batch conversions?

Post questions on how to use or achieve an effect in Inkscape.

How do I do batch conversions?

Postby hellocatfood » Mon Jan 24, 2011 10:32 am

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
I'm on The Web | Flickr | tumblr
User avatar
hellocatfood
 
Posts: 171
Joined: Fri Aug 29, 2008 8:49 pm

Re: How do I do batch conversions?

Postby brynn » Mon Jan 24, 2011 11:32 am

I seem to recall that IrfanView does batch conversions, but I don't know about SVG. http://www.irfanview.com/
Basics:
> Help menu > Tutorials
> a Quick Guide to Inkscape
Manual:
> Inkscape: Guide to a Vector Drawing Program
Tutorials:
> Inkscape Community
Development news
> Google+
Gallery:
> Inkscape Community Gallery
User avatar
brynn
 
Posts: 6672
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA

Re: How do I do batch conversions?

Postby hellocatfood » Mon Jan 24, 2011 9:38 pm

Thanks, but I'm using Ubuntu so can't really run Irfanview
I'm on The Web | Flickr | tumblr
User avatar
hellocatfood
 
Posts: 171
Joined: Fri Aug 29, 2008 8:49 pm

Re: How do I do batch conversions?

Postby markjensen » Thu Jan 27, 2011 2:56 am

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.
markjensen
 
Posts: 9
Joined: Thu Jan 27, 2011 2:52 am

Re: How do I do batch conversions?

Postby hellocatfood » Fri Jan 28, 2011 5:42 am

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
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!
I'm on The Web | Flickr | tumblr
User avatar
hellocatfood
 
Posts: 171
Joined: Fri Aug 29, 2008 8:49 pm

Re: How do I do batch conversions?

Postby brynn » Fri Jan 28, 2011 10:25 am

Wow, nice work hellocatfood! Image
Basics:
> Help menu > Tutorials
> a Quick Guide to Inkscape
Manual:
> Inkscape: Guide to a Vector Drawing Program
Tutorials:
> Inkscape Community
Development news
> Google+
Gallery:
> Inkscape Community Gallery
User avatar
brynn
 
Posts: 6672
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA

Re: How do I do batch conversions?

Postby milos.kroulik » Mon Oct 07, 2013 6:40 pm

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.
milos.kroulik
 
Posts: 1
Joined: Thu Oct 03, 2013 7:54 pm


Return to Help with using Inkscape

Who is online

Users browsing this forum: Google [Bot] and 9 guests