Skip to content

feature: InlineShape.replace_image() #192

Open
@ghost

Description

I am using python-docx (python 3) to automatically generate and edit MS word document.

I see there are functions to add and replace text, but how about picture? The add_picture function only add picture in the end of the document.

For example, suppose I have a existing document (test.docx) with 2 pages. I want to:

  1. add a picture on page 1, before paragraph('Figure 1: Example Figure') --- actually, this paragraph is the caption of the figure.
  2. In the future, replace this picture by a new picture.

Can anyone please show me how to do it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions