Words are not counted when text is inside of shapes in word documents

Using the API to count words per page in the word document. When the text is in shapes (for example, labels in rectangular boxes) the words are not counted. See attached image - the same text in 2 pages, in 1st just the text, in the second - the page is inside the rectangular shape. The results of words count for the first page - 25 words, for the 2nd page - 0 words.

Screenshot 2020-03-02 at 16.00.39.png (7.3 KB)

@rvanlaak

Thanks for your inquiry. To read text inside the shapes, you need to set includeTextInShape parameter to true. Hopefully it will resolve the issue. However, if the issue persists then please share your sample document here for further investigation.

curl -X GET "https://api.aspose.cloud/v4.0/words/ShapeText.docx/statistics?folder=Temp&includeComments=false&includeFootnotes=false&includeTextInShapes=true" 
-H "accept: application/json" 
-H "authorization: Bearer [Access_Token]" 
-H "x-aspose-client: Containerize.Swagger"
1 Like

Thank you @tilal.ahmad, includeTextInShape works!

1 Like