scanny / python-pptx

Create Open XML PowerPoint documents in Python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot extract text from shape if it has equation

santibreo opened this issue · comments

I have a Powepoint as simple as the attachment and I cannot extract the text using the code in Accessing the text frame.

It seems like, if the shape has an equation inside, it has not text_frame.

It is weird because if I check shape.part.blob the text is there.
cannot_extract_text.pptx

Hmm, yeah, that's weird. The entire shape is "nested" in an <mc:AlternateContent> element which is why it doesn't appear in slide.shapes.

If the equation was a separate shape I expect this wouldn't happen (only the equation shape would be nested).