How to extract paragraphs instead of whole texts only for XWPFWordExtractor (POI Library) Java
Posted
by Mr CooL
on Stack Overflow
See other posts from Stack Overflow
or by Mr CooL
Published on 2010-03-30T11:53:13Z
Indexed on
2010/03/30
12:13 UTC
Read the original article
Hit count: 354
java
Hello, I know the following code could extract whole texts of the docx document, however, I need to extract paragraph instead. Is there are possible way??
public static String extractText(InputStream in) throws Exception {
JOptionPane.showMessageDialog(null, "Start extracting docx");
XWPFDocument doc = new XWPFDocument(in);
XWPFWordExtractor ex = new XWPFWordExtractor(doc);
String text = ex.getText();
return text;
}
Any helps would much appreciated. I need this so urgently.
© Stack Overflow or respective owner