Skip to content

how to read text along with inline shapes info? #286

@xiangnanscu

Description

@xiangnanscu

I have a simple docx file like this(just insert a inline png file to text):enter image description here

I've tried:

>>> x=docx.Document('12.docx')
>>> for p in x.paragraphs:
    print(p.text)


headend
>>> list(x.inline_shapes)
[]

And I unzip 12.docx file, found word/media/image1.png is the location. So is there a way to get a output like:

>>> for p in x.paragraphs:
    print(p.text_with_image_info)


head<word/media/image1.png>end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions