python-pptx icon indicating copy to clipboard operation
python-pptx copied to clipboard

Cannot extract text from shape if it has equation

Open santibreo opened this issue 1 year ago • 2 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

santibreo avatar Feb 29 '24 19:02 santibreo

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).

scanny avatar Mar 02 '24 21:03 scanny