mammoth.js icon indicating copy to clipboard operation
mammoth.js copied to clipboard

Working With Objects

Open dresch86 opened this issue 5 years ago • 0 comments

Hi all, Firstly, great library! I am using it for converting exams made in Word to Blackboard Learn test packages. I would like to be able to convert WMF vectors to SVGs. What is the best way to have a function called on every w:object the parser encounters to see if there is a relationship to a WMF somewhere.

The program I use for drawing chemical structures outputs WMF files when copy / pasted into Word, so there isn't much I can do about changing that. I know images would be easier to handle programmatically but we need to maintain round trip editing therefore the vector format is a necessary evil.

If I can hook into the parser to run a few checks on the w:object tags, I can manage the rest. I see in the lib/docx/body-reader.js file the w:object is a property of the xmlElementReaders however before I rewrite and pull that code I wanted to see if you think there is a better way. Happy to make a contribution if you think its worthwhile.

Dan

dresch86 avatar May 24 '20 04:05 dresch86