How to automate EMF\WMF to SVG conversion using Inkscape?

Hi,

We would like to convert many EMF\WMF files to SVG format.
We'd like to try Inkscape but these export options lack from its command-line options:
http://inkscape.org/doc/inkscape-man.html

Any idea?
Thanks
netformxAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

NrisimhaCommented:


Dear netformx,

The Inkscape has not by default an batch option for converting EMF, WMF to SVG.

From the command prompt you can convert ONLY one file to SVG.:

inkscape AN01124_.EMF --export-plain-svg=AN01124_.svg


So, there is a one solution if ONE command can be executed - you have to make a BATCH file with BAT extension to convert MANY emf or wmf files to SVG format.

I would like to help you. And I will help you.
I made a BATCH script that make this:

@ECHO OFF

echo.
echo.

echo.   Choose source format format:
echo.
set /p Input1=   Graphic file type:  
echo.
echo.

FOR %%I IN (*."%Input1%") DO (
setlocal enabledelayedexpansion

inkscape "%%~nI.!Input1!" --export-plain-svg="%%~nI".svg

)

Open in new window



regards

Nrisimha

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
NrisimhaCommented:


First sorry for an error. In the sixth line must be replaced:

echo.   Choose source format format:

Open in new window


with this one:

echo.   Choose source graphic format:

Open in new window



Be aware that EMF2SVG will convert not only EMF files. You can experiment also with WMF.

And now, copy this text and paste in a Notepad. Then save this as EMF2SVG.bat in a folder where exist your default Inkscape.exe file.
If you want check this BATCH file how does it convert your EMF files you need to put a 4 EMF files like I did in the same folder where exist EMF2SVG.bat and Inkscape.exe:

 Converter to SVG vector files
0
NrisimhaCommented:


Hello again,

I will continue to explain the process of conversion of EMF files into SVG files.

Now, the only that you need is to double click with your mouse a file EMF2SVG.bat and the CMD window will be opened. You have to write your graphic file extension, in this case it will be emf and just press ENTER key:

 CMD conversion to SVG
And conversion is starting. During a this conversion you will see in a CMD window only a cursor blinking. When conversion of these 4 files will be finished, a CMD window will be closed, because a BATCH file EMF2SVG.bat is finished a conversion.

Look at you folder where are placed your EMF files. Now, you can see also the files with same name but with SVG extension:

 Final SVG files
Now, you can freely open these SVG files in the Inkscape:

 SVG files opened with Inkscape
It's OK. I hope you are a satisfied. I can also modify this BATCH script and put here.

So, I will attach a ZIP file with these EMF files and one EMF2SVG.txt file.
I can't send a BAT and SVG files in the ZIP file. The only thing you will make is to rename EMF2SVG.txt file into EMF2SVG.bat file.

 Inkscape.zip

And now, you can make all these conversions and processes as I did.

with my best regards

Nrisimha


0
CompTIA Security+

Learn the essential functions of CompTIA Security+, which establishes the core knowledge required of any cybersecurity role and leads professionals into intermediate-level cybersecurity jobs.

NrisimhaCommented:


Tutorial for converting EMF, WMF and PNG files into SVG format under Windows XP SP3.


To use BATCH file from any folder where are placed EMF, WMF and PNG files we have to configure a path of the Inkscape that is installed on your PC under Windows.

First we open Control Panel and then click on the icon System and then we have opened window System Properties:

SVG1
Then click on the Advanced tab and press a button Environment Variables.
The next window appears and in the list with System variables select Path variable:

SVG2
Then click on the Edit button. Now we have to set path for Inkscape program so we can execute a EMF2SVG.BAT in the every folder on hard disc.

Standard Inkscape package is installed in C:\Program Files\Inkscape. So, this is our path that we have to add to existed path. If you have installed Inkscape in other hard disc or folder then use that path.
First we need to click with mouse in Variable value field and press End key on the keyboard to can a enter a values that we will need:

SVG3
Then we write an semicolon sign (   ;   )  at the end of that field.
After that semicolon we enter a path for the Inkscape - C:\Program Files\Inkscape

SVG4
Then we click OK button. And once again. And finally we press OK button to close System Properties window. And at last we close a Control Panel.

Now, we restart PC.

So, this is the all explanation. Be aware that BATCH file EMF2SVG.BAT have to be placed in a folder where are our EMF or WMF or PNG files that we want to convert into SVG files.

Only that you need for converting is to double click with mouse on that EMF2SVG.BAT file that is put in the folder where are your images that you want convert into SVG. And when the BATCH file is open, you only need to type a file format of images that are in folder.
But, you can enter ONLY ONE file format value - EMF or WMF or PNG.

Then simply press ENTER key on the keyboard and wait some time for conversion. For 16 EMF files, conversion was finished after 20 seconds.
After conversion, a CMD window will be closed and that is a sign that your conversion is finished.

good luck

Nrisimha

0
NrisimhaCommented:


Hello netformx,

My wish is that you come to visit this post and study these answers for your question, and then say does it work on your PC.

regards

Nrisimha
0
netformxAuthor Commented:
Hi Nrisimha,

So far I have tested the part of using the syntax you suggested to invoke the conversion (from command prompt and from an app in run-time):
inkscape AN01124_.EMF --export-plain-svg=AN01124_.svg
This works fine! I tried myself similar things, but apparently my syntax was wrong.
I'll post more comments regarding your other suggestions when I get to them (if I have any).

You've been a great help!
Thank you.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Graphics Software

From novice to tech pro — start learning today.