use of org.apache.poi.xslf.usermodel.XSLFShapeContainer in project poi by apache.
the class XSLFPowerPointExtractor method extractText.
private static void extractText(XSLFShapeContainer data, boolean skipPlaceholders, StringBuilder text) {
for (XSLFShape s : data) {
if (s instanceof XSLFShapeContainer) {
extractText((XSLFShapeContainer) s, skipPlaceholders, text);
} else if (s instanceof XSLFTextShape) {
XSLFTextShape ts = (XSLFTextShape) s;
// Skip non-customised placeholder text
if (!(skipPlaceholders && ts.isPlaceholder())) {
text.append(ts.getText());
text.append("\n");
}
} else if (s instanceof XSLFTable) {
XSLFTable ts = (XSLFTable) s;
// Skip non-customised placeholder text
for (XSLFTableRow r : ts) {
for (XSLFTableCell c : r) {
text.append(c.getText());
text.append("\t");
}
text.append("\n");
}
}
}
}
Aggregations