becta logo
[oats-sig] Ang: Re: Ang: Re: wmf to svg conversion

Andy Judson andy.judson at gmail.com
Tue Jul 1 09:21:34 BST 2008

Article: [oats-sig] Ang: Re: Ang: Re: wmf to svg conversion

i had a wee play with using imagemagick but it constantly failed to generate
any sensible svg markup - i.e. the xml wasn't even valid and there was not
enough info in it to work out how it was trying to encode the image - be it
a wrapper to the source file or the actual points etc.

When i used potrace before it actually worked out the points etc, but like
Jonathan says so many of these convertion tools simply wrap the source image
and this is useless imho

Andy.

2008/7/1 Robert Rasiewicz <robert.wk at gmail.com>:

> Mats,
>
> In the simplest form you could create a .bat file with a single line like
> this (that's in Windows, in *nix you have more versatile tools at your
> disposal)
>    for /f %%f in ('dir /b *.wmf') do java -jar wmf2svg-0.8.1.jar %%f
> %%f.svg
>
> This will loop on all wmf files in the current directory and execute the
> java -jar (..) command on each of them - resulting file names will be in the
> form of <filename>.wmf.svg.
>
> Alternatively you could use a perl script - put the below into .pl file and
> execute using http://www.activestate.com/store/activeperl/download/
> either by doubleclick or through commandline "perl <file>.pl"
>
> @files = <*.wmf>;
> foreach $file (@files) {
>   $newfilename = substr($file,0,-4) . ".svg";
>   $command = "java -jar wmf2svg-0.8.1.jar " . $file . " " . $newfilename;
>   exec ($command);
> }
>
> This will loop on all .wmf files in the current directory and convert them
> into <filename>.svg
>
> hth
>
> r.
>
>
> On Mon, Jun 30, 2008 at 9:27 PM, Mats Lundälv <mats.lundalv at vgregion.se>
> wrote:
>
>> Thanks all for your help!
>>
>> My point is really to find a usable direct path directly from the wmf/emf
>> vector format to the svg vector format.
>>
>> Steeve: As far as I had understood the ImageMagick package only really
>> fully supports raster graphics formats and not vector graphics. This libwmf
>> seems to provide a possible add-on to IM, but looks a bit uncertain, as in
>> alpha stage, and these projects don't seem very end-user oriented. I'll have
>> a look.
>> Do you know what tools Garry and friends use?
>>
>> Robert, I have just downloaded the wmf2svg jar file you pointed me to,
>> thanks. There are no explicit instructions for batch conversions there -
>> have you found a format for that?
>> This one looks as it could have been an implementation of the batik java
>> classes - same Apache license, but no clear pointers to batik, as far as I
>> can see.
>> I'll go ahead testing this and the other alternatives I have.
>>
>> I'll try to remember to give you some feedback on how I succeed.
>>
>> Andy, thanks for your offer! I'll send you a couple of files if you care
>> for checking this up.
>>
>> Cheers,
>> Mats <mats.lundalv at sit.se>
>>
>> -----<oats-sig-bounces at lists.becta.org.uk> skrev: -----
>>
>> Till: "OATs Project Special Interest Group" <oats-sig at lists.becta.org.uk>
>> Från: Andy Judson <andy.judson at gmail.com>
>> Sänt av: <oats-sig-bounces at lists.becta.org.uk>
>> Datum: 2008-06-30 15:27
>> Ärende: Re: [oats-sig] Ang: Re: wmf to svg conversion
>>
>>
>> Hi Robert, i can't remember which version... will try to check later.
>>
>> Mats / Steve (sorry can't remember who started this thread) - if you could
>> send me a couple of the wmf files i'll see what is involved in patching my
>> code... it should be easier than the png technique - i think when i did this
>> i had to use the potrace as a proxy to trace the symbol the result was then
>> made into an svg - worked quite well for bliss symbols although the were a
>> little round at the tips.
>>
>> 2008/6/30 Robert Rasiewicz <robert.wk at gmail.com>:
>>
>>> this did work for me nicely for wmf (I did not test the transparency,
>>> though)
>>>    http://code.google.com/p/wmf2svg/
>>>
>>> on the same test file I did try ImageMagick 6.3.7 11/21/07 convert.exe
>>> and it failed horribly
>>>
>>> which version of ImageMagick were you working against, Andy ?
>>>
>>> r.
>>>
>>>
>>> On Mon, Jun 30, 2008 at 1:03 PM, Steve Lee <steve at fullmeasure.co.uk>
>>> wrote:
>>>
>>>> Hey they look really interesting, I know someone who wants edge tracing.
>>>>
>>>> it's worth noting that wmf/emf are vector formats so conversion should
>>>> be easier.
>>>>
>>>> Steve
>>>>
>>>> 2008/6/30 Andy Judson <andy.judson at gmail.com>:
>>>> > I wrote a .net app to do this from png to svg for the bliss symbols
>>>> using
>>>> > the imagemagick library... but the code is at home and i can't
>>>> remember much
>>>> > about it... i can have a look if i can tweak it for you.
>>>> >
>>>> > other libraries to look at
>>>> >
>>>> > [1] http://delineate.sourceforge.net/
>>>> > [2] http://potrace.sourceforge.net/
>>>> >
>>>> > 2008/6/30 Steve Lee <steve at fullmeasure.co.uk>:
>>>> >>
>>>> >> oh Inkscape will import WMF so that's a good non-batch alternative
>>>> and
>>>> >> I think OO0 will if you 'break' the image after import.
>>>> >>
>>>> >> Steve
>>>> >>
>>>> >> 2008/6/30 Steve Lee <steve at fullmeasure.co.uk>:
>>>> >> >> I have been looking around again for tools to convert wmf/emf
>>>> graphic
>>>> >> >> files
>>>> >> >> to svg.
>>>> >> >
>>>> >> > Well the PHP web server tool of choice seems to be ImageMagick and
>>>> >> > while I have not tried it yet it looks like there are command line
>>>> >> > versions.
>>>> >> >
>>>> >> > http://www.imagemagick.org/script/index.php
>>>> >> >
>>>> >> > I came across SVG factory before and there's libwmf but there
>>>> doesn't
>>>> >> > seem to have been any activity since 2002
>>>> >> >
>>>> >> > http://wvware.sourceforge.net/libwmf.html
>>>> >> >
>>>> >> > I've not tried any of them yet as Garry exports directly to wmf or
>>>> SVG
>>>> >> > as required.
>>>> >> >
>>>> >> > --
>>>> >> > Steve Lee
>>>> >> > --
>>>> >> > Open Source Assistive Technology Software
>>>> >> > web: fullmeasure.co.uk
>>>> >> > blog: eduspaces.net/stevelee/weblog
>>>> >> >
>>>> >>
>>>> >>
>>>> >>
>>>> >> --
>>>> >> Steve Lee
>>>> >> --
>>>> >> Open Source Assistive Technology Software
>>>> >> web: fullmeasure.co.uk
>>>> >> blog: eduspaces.net/stevelee/weblog
>>>> >>
>>>> >>
>>>> >>
>>>> >
>>>> >
>>>>
>>>>
>>>>
>>>> --
>>>> Steve Lee
>>>> --
>>>> Open Source Assistive Technology Software
>>>> web: fullmeasure.co.uk
>>>> blog: eduspaces.net/stevelee/weblog
>>>>
>>>>
>>>>
>>>>
>>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.becta.org.uk/pipermail/oats-sig/attachments/20080701/1ff375b8/attachment.html 

  Main Becta Site  | Return to top