- Code: Select all
<w:p w:rsidR="00271DA2" w:rsidRDefault="003842F8" w:rsidP="00271DA2">
<w:r>
<w:rPr>
<w:noProof/>
<w:lang w:eastAsia="en-GB"/>
</w:rPr>
<w:pict>
<v:shapetype id="_x0000_t202" coordsize="21600,21600" o:spt="202" path="m,l,21600r21600,l21600,xe">
<v:stroke joinstyle="miter"/>
<v:path gradientshapeok="t" o:connecttype="rect"/>
</v:shapetype>
<v:shape id="Text Box 9" o:spid="_x0000_s1026" type="#_x0000_t202" style="position:absolute;margin-left:83.2pt;margin-top:15.9pt;width:225.75pt;height:24.35pt;z-index:251671552;visibility:visible;mso-wrap-style:square;mso-width-percent:0;mso-height-percent:0;mso-wrap-distance-left:9pt;mso-wrap-distance-top:0;mso-wrap-distance-right:9pt;mso-wrap-distance-bottom:0;mso-position-horizontal:absolute;mso-position-horizontal-relative:text;mso-position-vertical:absolute;mso-position-vertical-relative:text;mso-width-percent:0;mso-height-percent:0;mso-width-relative:margin;mso-height-relative:margin;v-text-anchor:top">
<v:textbox>
<w:txbxContent>
<w:p w:rsidR="00271DA2" w:rsidRDefault="001F7F20" w:rsidP="00271DA2">
<w:r>
<w:t>FIRST_NAME</w:t>
</w:r>
</w:p>
</w:txbxContent>
</v:textbox>
</v:shape>
</w:pict>
</w:r>
</w:p>
I've tried using
- Code: Select all
List<Object> paragraphs = getAllElementFromObject(document.getMainDocumentPart(), P.class);
for (Object p : paragraphs) {
List<Object> texts = getAllElementFromObject(p, Text.class);
for (Object t : texts) {
Text content = (Text) t;
System.out.println("* " + content.getValue());
}
}
But this only returns the text in the doc, and not text boxes. I tried:
- Code: Select all
List<Object> pics = getAllElementFromObject(document.getMainDocumentPart(), Pict.class);
for (Object p : pics) {
List<Object> texts = getAllElementFromObject(p, Text.class);
for (Object t : texts) {
Text content = (Text) t;
System.out.println("* " + content.getValue());
}
}
But this does not get the text within the w:pict tags.
Any suggestions@