Skip to content

header images share id-space with document #1121

Open
@eswarthammana

Description

@eswarthammana

python: 3.10.4
python-docx: 0.8.11
MS Office: 2016

Added two images to the word document body and an image as a header using MS word 2016(Manually added)
Document.xml file
document.xml
Header1.xml
header1.xml

The below details after add the word document using python-docx
Document.xml
document.xml
Header1.xml
header1.xml

It's clearly the id issue while during merge both id's are conflicting and overridden the other.
As a temp fix replaced the updated the image id's in the document.xml with the max(id) + 1.

My request is - how i can read the header1.xml image id. So that i will check for duplicate id presence and update the same id with max(id) + 1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions