How to extract paragraphs instead of whole texts only for XWPFWordExtractor (POI Library) Java
- by Mr CooL
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.