kakwa / libemf2svg

Microsoft (MS) EMF to SVG conversion library
GNU General Public License v2.0
95 stars 32 forks source link

libemf2svg doesn't handle EMF+ records conversion #12

Open ofirdev opened 7 years ago

ofirdev commented 7 years ago

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

kakwa commented 7 years ago

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.

ofirdev commented 7 years ago

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.

kakwa commented 7 years ago

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.

ofirdev commented 7 years ago

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

kakwa commented 7 years ago

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 commented 7 years ago

I've implemented it:

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

ofirdev commented 7 years ago

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

kakwa commented 7 years ago

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

ofirdev commented 7 years ago

Great, thanks.