Inkscape is a free, platform independent tool to work on vector graphics like svgs. Additionally it has got good commandline batch processing facilities which makes it the tool of choice for programmers.
See an example of how to crop or trim many svg files by commandline.
Inkscape to Batch Convert Image Files
Eps to Svg
Inkscape and Eps on Windows
Inkscape on Windows cannot handle eps
-files by default. To be able to handle eps
-files, it needs Ghoststcript. A fine description of what is to do to install Ghostscript so that Inkscape can handle eps files.
Script
To convert a lot of eps files to svg files at once, you can use tclkitsh and the following script:
set pathToInkscape "C:/Program Files/Inkscape/inkscape.exe"
set epsFiles [glob *.eps]
foreach f $epsFiles {
set fbasename [file rootname [file tail $f]]
if ![file exists $fbasename.svg] {
puts "$pathToInkscape $f --export-plain-svg=$fbasename.svg"
exec $pathToInkscape $f --export-plain-svg=$fbasename.svg
}
}
How?
- Save the script as
EpsToSvg.tcl
.
- Open the script in an editor and adapt the
pathToInkscape
. Save.
- Open a command shell and cd to the directory where your eps files are located.
- Then run
tclkitsh EpsToSvg.tcl
.
Svg to Pdf
To convert a lot of svg files to pdf files at once, you can use tclkitsh and this script:
This script creates one pdf from every svg in the current directory.
set pathToInkscape "C:/Program Files/Inkscape/inkscape.exe"
set inputFiles [glob *.svg]
foreach f $inputFiles {
set fbasename [file rootname [file tail $f]]
if ![file exists $fbasename.pdf] {
puts "$pathToInkscape $f --export-pdf=$fbasename.pdf"
exec $pathToInkscape $f --export-pdf=$fbasename.pdf
}
}
Inkscape Without Gui
There is the additional commandline parameter -z
or --without-gui
which prevents that Inkscape opens a window when using with commandline only. Pitily, it seems that most of the --verb
commands do not work without gui. It’s been reported as bug in 2011 but not fixed until at least 2017.