jure / mathtype_to_mathml

Converts equations from MathType format (MTEF) to MathML.
MIT License
25 stars 19 forks source link

OLE2 signature is invalid // ruby script conversion error #9

Open dasanb opened 2 years ago

dasanb commented 2 years ago

We are trying to convert MathType binary files to MathML from a Docx file, while converting the MathType binary file (eg: image1.wmf), the below error is thrown,

Code Used:

mathml = MathTypeToMathML::Converter.new('image3.wmf').convert

Error:

base.rb:378:in `validate!': OLE2 signature is invalid (Ole::Storage::FormatError)

        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/ruby-ole-1.2.12.2/lib/ole/storage/base.rb:370:in `initialize'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/ruby-ole-1.2.12.2/lib/ole/storage/base.rb:112:in `new'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/ruby-ole-1.2.12.2/lib/ole/storage/base.rb:112:in `load'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/ruby-ole-1.2.12.2/lib/ole/storage/base.rb:79:in `initialize'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/ruby-ole-1.2.12.2/lib/ole/storage/base.rb:85:in `new'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/ruby-ole-1.2.12.2/lib/ole/storage/base.rb:85:in `open'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/mathtype-0.0.8/lib/mathtype.rb:12:in `initialize'
        from D:/Tool_Development/XSweet/wmf-test/mathtype_to_mathml/lib/mathtype_to_mathml.rb:12:in `new'
        from D:/Tool_Development/XSweet/wmf-test/mathtype_to_mathml/lib/mathtype_to_mathml.rb:12:in `initialize'
        from test.rb:3:in `new'
        from test.rb:3:in `<main>'

MathType_WMF_images.zip