g21589 / wmf2canvas

Convert WMF/EMF (Windows Metafile) image file to HTML5 canvas by using pure javascript.
http://g21589.github.io/wmf2canvas/
34 stars 13 forks source link

EMF support? #1

Open kjhughes opened 6 years ago

kjhughes commented 6 years ago

Thank you for making your library available.

The project mentions both WMF and EMF, but as far as I can see, there is no actual support for EMF. Am I missing something, or is EMF support just in the planning stages?

photopea commented 6 years ago

Hey @kjhughes , you can use https://github.com/photopea/UDOC.js to parse EMF and WMF files!

kjhughes commented 6 years ago

@photopea That looks very promising. Will you be writing/releasing a toSVG.js writer? From my initial trials, your Photopea application appears to do a great job of converting from EMF to SVG. Would love to see such capabilities in UDOC.js or otherwise made available in an MIT licensed library. Thank you for your response and for making UDOC.js available.

photopea commented 6 years ago

Actually, Photopea converts every format to PSD, and then, from PSD to another format (SVG in your case).

But UDOC.js allows to do a direct conversion. Making ToSVG would probably be quite easy (we did not need it, as we have a direct PSD to SVG converter, which preserves layer structure, layer names, which are not possible in WMF / EMF / PDF).

kjhughes commented 6 years ago

@photopea: I see, and that makes sense.

A library with a EMF-to-SVG conversion path that passes through PSD would be absolutely fine -- doesn't have to be direct. Is that code available with similarly unencumbered licensing as UDOC.js, or might it be? It would be uniquely valuable as I do not believe any other JavaScript-based conversion path exists that's as good as Photopea's solution.

photopea commented 6 years ago

No, PSD-related stuff in Photopea is not open source. But I can add ToSVG.js into UDOC.js .

kjhughes commented 6 years ago

@photopea: Excellent. Thank you both for UDOC.js under MIT and offering to add toSVG.js too. Will be very cool.

Thank you also for the Photopea application itself. Very nice work.