As I said, the traversal returns the elements in the order they appear in document.xml
I've looked at your document.xml, and here is what i found:
- the Table, which includes
- Code: Select all
<w:framePr w:w="3402" w:h="1701" w:hSpace="142" w:wrap="around" w:vAnchor="page" w:hAnchor="page" w:x="7939" w:y="12702"/>
- a paragraph with 4 picts;
the first is "image A":
- Code: Select all
<w:pict>
<v:shape id="_x0000_s1217" type="#_x0000_t75" style="position:absolute;margin-left:4.05pt;margin-top:59.5pt;width:198.55pt;height:301.9pt;z-index:-251661312;mso-position-horizontal-relative:page;mso-position-vertical-relative:page">
<v:imagedata r:id="rId9" o:title="06_04_Fis_E193_06_21871_jpg_preview_jpeg_preview" cropbottom="3914f" cropright="4460f"/>
<w10:wrap anchorx="page" anchory="page"/>
</v:shape>
</w:pict>
the second is "image B":
- Code: Select all
<w:pict>
<v:shape id="_x0000_s1218" type="#_x0000_t75" style="position:absolute;margin-left:154.65pt;margin-top:59.5pt;width:476.25pt;height:301.8pt;z-index:-251662336;mso-position-horizontal-relative:page;mso-position-vertical-relative:page">
<v:imagedata r:id="rId10" o:title="03_01_TMo_E327_05_2_M_jpg_preview_jpeg_preview" cropbottom="3193f"/>
<w10:wrap anchorx="page" anchory="page"/>
</v:shape>
</w:pict>
- Code: Select all
<w:pict>
<v:rect id="_x0000_s1026" style="position:absolute;margin-left:0;margin-top:369.2pt;width:595.3pt;height:441pt;z-index:-251660288;mso-position-horizontal-relative:page;mso-position-vertical-relative:page" fillcolor="#878c96" stroked="f">
<w10:wrap anchorx="page" anchory="page"/>
</v:rect>
</w:pict>
the fourth is the company logo:
- Code: Select all
<w:pict>
<v:shape id="Logo_Konzept" o:spid="_x0000_s1028" type="#_x0000_t75" style="position:absolute;margin-left:481.1pt;margin-top:19.85pt;width:94.5pt;height:30.2pt;z-index:251657216;mso-position-horizontal-relative:page;mso-position-vertical-relative:page">
<v:imagedata r:id="rId11" o:title=""/>
<w10:wrap anchorx="page" anchory="page"/>
</v:shape>
</w:pict>
Note that all those picts are absolutely positioned.
- a paragraph with 2 R/Pict/CTShape/CTTextbox elements each
absolutely positioned first "R2":
- Code: Select all
<w:pict>
:
<v:shape id="_x0000_s1213" type="#_x0000_t202" style="position:absolute;margin-left:430.5pt;margin-top:52.05pt;width:133.5pt;height:19.1pt;z-index:251661312" filled="f" stroked="f">
<v:textbox style="mso-next-textbox:#_x0000_s1213">
<w:txbxContent>
second "L1":
- Code: Select all
<w:pict>
<v:shape id="_x0000_s1219" type="#_x0000_t202" style="position:absolute;margin-left:-37.5pt;margin-top:52.05pt;width:133.5pt;height:19.1pt;z-index:251662336" filled="f" stroked="f">
<v:textbox style="mso-next-textbox:#_x0000_s1219">
<w:txbxContent>
- the block lower left, inc red text box, a paragraph with the title, and a paragraph with the subtitle
- the bottom right company text box etc
So the reason things appear on the printed page and in Word's page layout mode in a different order to document.xml (and how docx4j sees things) is largely the absolute positioning.
You can read those values from org.docx4j.vml.CTShape, using getStyle().
So you can work out the location of the images easily enough. What is missing at an XML level is any association between an image and the way the labels were done. I suppose you can guess which belongs to which though, by their positions.