Page 1 of 1

Issue with wp:docPr id in word document

PostPosted: Thu Jan 28, 2021 6:54 pm
by Alanberger
I run into an issue where office356 complains about the id of a docPr element being nonunique in the following construction:

<w:drawing>
<wp:inline distT="0" distB="0" distL="0" distR="0">
<wp:extent cx="5080000" cy="5080000"/>
<wp:effectExtent l="0" t="0" r="0" b="0"/>
<wp:docPr id="0" name="" descr=""/>
<wp:cNvGraphicFramePr>
<a:graphicFrameLocks noChangeAspect="true"/>
</wp:cNvGraphicFramePr>
<a:graphic>
<a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/picture">


The .docx is converted from html.
If I make the id unique compared to other docPr elements then word opens the .docx without problems. Strange thing is that I have other word files where this id being 0 multiple times, is not a problem.

It appears that xhtml importer always generates inline images with an id of 0 (https://github.com/plutext/docx4j-Impor ... fault.java) . But I'm no expert, so that might be wrong.

Does anyone have a hint on how to handle this?

Re: Issue with wp:docPr id in word document

PostPosted: Fri Jan 29, 2021 1:26 pm
by jason
You're right, this will need to be fixed. Tracking now at https://github.com/plutext/docx4j-ImportXHTML/issues/71 which identifies the source of the problem