These fields are likely precomputed and stored in fproperties in the document by Word upon saving. POI does not populate them currently, not sure how much effort it would be to correctly compute these things and how costly it would be. It is a bit similar to formulas in Excel files, you also have to update them with some helper method before writing the file to have the results set correctly.
Dominik Am 03.06.2015 12:24 schrieb "prasathbala" <[email protected]>: > I had created a docx file using poi-3.10 but when i tried to retrieve the > number of lines in docx it is showing zero but in actual there are 841 > lines > in the docx file. I tried using the below code > > XWPFDocument doc1 = new > XWPFDocument(POIXMLDocument.openPackage("PageCounter.docx")); > System.out.println("lines using method 2 --> " + > > doc1.getProperties().getExtendedProperties().getUnderlyingProperties().getLines()); > System.out.println("word 2 --> " + > > doc1.getProperties().getExtendedProperties().getUnderlyingProperties().getWords()); > > Suggest a way to find the line count using poi. But when i copy the content > in new file and using the above code it is working fine. Docx created using > POI is creating problem for me. > > > > > -- > View this message in context: > http://apache-poi.1045710.n5.nabble.com/Getting-the-line-count-of-docx-file-created-using-POI-3-10-tp5719024.html > Sent from the POI - User mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
