Forum


Replies: 7   Views: 4632
Add math equation with mathml not working
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by fpa.777  · 25-08-2014 - 18:16

Hello, I'm trying to evaluate the "addMathEquation" method in trial version, but it doesn't seem to work with MathML. I executed the example code ( didn't even modified it), which comes in the trial version, but no equation appeared in the created document. Is this exclusive to paid versions? I'm really thinking on buying the product, but it's important that these features related to equations work as expected. Link to the code: http://pastebin.com/3qi8CYrT (couldn't paste without breaking the code) Thank you!

Posted by admin  · 26-08-2014 - 06:32

Hello, Which program do you use to open the DOCX? Please attach the generated DOCX to check it. Regards.

Posted by fpa.777  · 26-08-2014 - 14:40

I tried opening with Word 2013 and LibreOffice 2013. Both could open the document without problems, but there were no equations. I forgot to mention before that this only happens when using MathML, but with OMML everything works as intended. replaceVariableByWordFragment() also doesn't work; with MathML nothing is shown, and with OMML the document gets corrupted I'm running XAMPP 1.8.3, PHP5.5.

Posted by admin  · 27-08-2014 - 11:02

Hello, Instead of this line: $docx->addMathEquation($mathML, 'mathmml'); use this one: $docx->addMathEquation($mathML, 'mathml'); And please post if you see the eq. Regards.

Posted by fpa.777  · 27-08-2014 - 13:21

I hadn't noticed that, sorry. Ok, so now it worked for inserting the equation like a block, but the inline part, which was already correct, still isn't working. Any idea why? I wonder if it's due to the fact that I'm using the trial version, with those encrypted files. Thanks.

Posted by admin  · 27-08-2014 - 14:18

Hello, The MathEq is not supported, and phpdocx will add support in a next version. Regards.

Posted by Shukur  · 23-10-2014 - 07:13

when you insert other code mathml an error occurs. Can you explain why? And in the paid version will be the same error?

Posted by admin  · 23-10-2014 - 08:16

Hello, The included examples work fine and the API is correct: http://www.phpdocx.com/api-documentation/word-content/add-math-OMML-Word-document-with-PHP You can't include other HTML code in the MathML string. Regards.