[Libreoffice] export mathml

Александр Лаврущенко kpykcb at gmail.com
Thu Mar 31 01:19:51 PDT 2011


Hi,

sorry i forgot to mention some bacis info and question was not realy clear:

- system: debian wheezy/sid
- LibreOffice 3.3.1
OOO330m19 (Build:8)
tag libreoffice-3.3.1.2, Debian package 1:3.3.1-1
- python-uno           1:3.3.1-1
- uno-libs3            1.7.0+LibO3.3.1-1

How i can export MathML code from formula embedded object? Seems some time ago
it was possible with getMathML method, but no its not AFAIK. Maybe
there are other ways?

2011/3/31 Александр Лаврущенко <kpykcb at gmail.com>:
> Hi all,
>
> i want to export mathml from python script. I saw at the forum Basic
> code snippet:
>
> http://www.oooforum.org/forum/viewtopic.phtml?t=59791
>
> which looks like:
>
> for nObjectCounter = 0 to oDoc.embeddedObjects.count - 1
> oEmbeddedObject = oEmbeddedObjects.getByIndex(nObjectCounter)
> if oEmbeddedObject.clsid = "078B7ABA-54FC-457F-8551-6147e776a997" then
> nMathObjects = nMathObjects + 1
> oMathObject = oEmbeddedObject.embeddedObject
> mathml = oMathObject.getMathML
> end if
> next
>
> I translated this to python code, but seems that  oMathObject here
> dont have any method named getMathML.
>
> So question is, what changed in API and how i can get mathml from
> formula object:
>
>>doc = desktop.loadComponentFromURL(url, "_blank", 0, ())
>>x=doc.EmbeddedObjects.getByIndex(2)
>>x.EmbeddedObject.Formula
>     <58> u'{ 9x + 14 =17}'
>>x.EmbeddedObject.getMathML                 # no such method
>
>
> Thanks for help.
>
> P.S. Provided Basic code give the same result.
>


More information about the LibreOffice mailing list