Word count error

If I check the number of words directly in the word file, it is 16814 characters, but if I read the number of words in the library, it is 16816 characters.

try_1

Document doc = new Document(path);
doc.updateWordCount();
doc.updatePageLayout();
doc.getBuiltInDocumentProperties().getWords(); // return 16816

try_2

Document doc = new Document(path);
for (Run run : (Iterable) doc.getChildNodes(NodeType.RUN, true)){
    if(run.getFont().getHidden())
        run.remove();
}
doc.updateWordCount();
doc.updatePageLayout();
doc.getBuiltInDocumentProperties().getWords();  // return 16816

Here is my word file :
wrong.docx (163.4 KB)

@URLENCE Thank you for reporting the problem to us. For a sake of correction it has been logged as WORDSNET-24090. We will keep you informed and let you know once it is resolved.

A post was split to a new topic: Returned word count is incorrect

The issues you have found earlier (filed as WORDSNET-24090) have been fixed in this Aspose.Words for Java 22.10 update also available on Maven.