libemf2svg icon indicating copy to clipboard operation
libemf2svg copied to clipboard

libemf2svg doesn't handle EMF+ records conversion

Open ofirdev opened this issue 8 years ago • 9 comments

I'm getting an empty SVG when converting this EMF taken from here.

ofirdev avatar May 12 '17 15:05 ofirdev

libemf2svg doesn't handle EMF+ records as of now:

https://github.com/kakwa/libemf2svg#emfemf-record-type-coverage

Maybe in a few years when most of the bugs in EMF (not +) are solved :).

There are tons of things I need to fix, the first that comes to my mind is the handling of clipping forms.

Actually this test file seems to be coming from http://libuemf.sourceforge.net/ which I use for EMF record parsing.

Renaming the bug to a more accurate name.

kakwa avatar May 12 '17 16:05 kakwa

Is it possible to have a flag that check if the file is supported before converting? That way I can fallback to LibreOffice if the file has EMF+ records. The readme has the --emfplus flag but I'm not sure what it does.

ofirdev avatar Jun 09 '17 09:06 ofirdev

The emfplus flag enable the parsing of EMF+ records (FYI, EMF+ records are put inside EMF Comment records). Right now, all it does is displaying the records content in verbose mode, it doesn't handle any conversion.

kakwa avatar Jun 09 '17 11:06 kakwa

Is it possible to detect a file with EMF+ records or output an error in case there are unsupported records?

ofirdev avatar Jun 09 '17 11:06 ofirdev

Technically, it's possible: parsing of the document, inspect EMF comment records to see if it has EMF+ flag. It's not that complex, but it's not implemented yet.

kakwa avatar Jun 09 '17 12:06 kakwa

I've implemented it:

https://github.com/kakwa/libemf2svg/commit/833e2f7f04bfae4113fd3aab0a6bc3d7a72da445

kakwa avatar Jun 12 '17 21:06 kakwa

Thanks. Is it possible to use this function from the command line?

ofirdev avatar Jun 13 '17 05:06 ofirdev

No, but you can easily create a small C code to have your own check based on the following code:

https://github.com/kakwa/libemf2svg/blob/master/goodies/check_emfp.c

kakwa avatar Jun 13 '17 06:06 kakwa

Great, thanks.

ofirdev avatar Jun 13 '17 07:06 ofirdev