List of usage examples for org.apache.poi.xwpf.usermodel XWPFRun getPictureText
public String getPictureText()
From source file:apachepoitest.DocumentPropertyEnumerator.java
public static void showParagraphElementProperties(List<XWPFRun> rl) { System.out.println("\nELEMENTS: "); int counter = 1; for (XWPFRun r : rl) { if (r.toString().trim().length() > 0) { System.out.println("#" + counter++ + ": " + r.toString()); } else {// ww w . j av a 2 s .c o m //Ignore spaces, uncomment to display spaces and comment out "continue" //System.out.println("#" + counter++ + ": <SPACE>"); continue; } if (r.getColor() != null) { System.out.println("COLOR: " + r.getColor()); } if (r.getFontFamily() != null) { System.out.println("FONT: " + r.getFontFamily()); } if (r.getFontSize() > 0) { System.out.println("FONT SIZE: " + r.getFontSize()); } if (r.getPictureText().length() > 0) { System.out.println("PIC TEXT: " + r.getPictureText()); } if (r.getTextPosition() > 0) { System.out.println("TEXT POS: " + r.getTextPosition()); } if (r.isBold()) { System.out.println("BOLD: " + r.isBold()); } if (r.isItalic()) { System.out.println("ITALIC: " + r.isItalic()); } if (r.isStrike()) { System.out.println("STRIKETHROUGH: " + r.isStrike()); } if (!r.getUnderline().toString().equals("NONE")) { System.out.println("UNDERLINE: " + r.getUnderline().toString()); } if (!r.getSubscript().toString().equals("BASELINE")) { System.out.println("Subscript: " + r.getSubscript().toString()); } System.out.println(""); } }
From source file:apachepoitest.XWPFParagraphClone.java
License:Apache License
/** * Returns any text from any suitable pictures in the paragraph *///from w w w . ja v a2s . c o m public String getPictureText() { StringBuffer out = new StringBuffer(); for (XWPFRun run : runs) { out.append(run.getPictureText()); } return out.toString(); }