Is there any way to store/edit altText
of an image with Apache POI?
I tried to find proper function, but nothing inside of the XWPFPictureData
object related to altText
.
Am I missing something or I have to cast XWPFPictureData
to another class which is it has access to altText
of image?
We found this from XWPFPicture
's properties. Like this.
for (XWPFParagraph paragraph : docx.getParagraphs()) {
for (XWPFRun run : paragraph.getRuns()) {
for (XWPFPicture embeddedPicture : run.getEmbeddedPictures()) {
String description = embeddedPicture.getDescription();
// Something
}
}
}