Как я могу получить количество строк из моего сгенерированного файла .docx в java?

     public static void Worddoc(String Finalcombined) {


    String exampleString = "மதுரையில் நடந்த கலைவிழாவுக்கு மந்திரி          சுப்பிரமணியம் தலைமை வகித்துப்பேசினார் அவர் கூறியதாவது";

    //Blank Document
    XWPFDocument document = new XWPFDocument();
    //Write the Document in file system
    FileOutputStream out = null;
    FileOutputStream outodt = null;
    try {
        out = new FileOutputStream(new File("LineCounter.docx"));

    } catch (FileNotFoundException ex) {
        Logger.getLogger(WordDocCreation.class.getName()).log(Level.SEVERE, null, ex);
        JOptionPane.showMessageDialog(null, "Error --> " + ex.toString());
    }

    try {
        XWPFParagraph paragraph = document.createParagraph();
        schemasMicrosoftComOfficeWord.CTWrap.Factory.parse("Latha")
        );
        run.setFontFamily("Latha");
        run.getCTR().getRPr().getRFonts().setHAnsi("Latha");
        run.setFontSize(10);
        run.setText(exampleString);
        document.write(out);
    } catch (IOException ex) {
        Logger.getLogger(WordDocCreation.class.getName()).log(Level.SEVERE, null, ex);
    }
    try {
        out.close();
    } catch (IOException ex) {
        Logger.getLogger(WordDocCreation.class.getName()).log(Level.SEVERE, null, ex);
    }
    XWPFDocument doc = new XWPFDocument(POIXMLDocument.openPackage(lowerFilePath));
    int i = doc.getProperties().getExtendedProperties().getUnderlyingProperties()..getLines();
    System.out.println("i" + i);
    System.out.println("PageCounter.docx written successully");
}

/* Это мой код. Он хорошо работает в созданном вручную текстовом документе, но не работает в сгенерированном текстовом документе (Lineounter.docx), который использует класс XWPFDOcument.


person Sriram S    schedule 03.06.2015    source источник
comment
Ознакомьтесь с этим решением, приведенным ранее: - stackoverflow.com/a/26275750/4531527   -  person Nesh    schedule 03.06.2015
comment
Какую версию банки для пои вы используете?   -  person Prasath Bala    schedule 03.06.2015
comment
poi-3.7.jar @ Прасат Бала   -  person Sriram S    schedule 03.06.2015