According to this function com.aspose.words.Node[] paragraphs = doc.getChildNodes(com.aspose.words.NodeType.PARAGRAPH, true).toArray();)
I can read all text from doc files. But using this function I got text only from first 7 pages.
So, I found another example here (http://www.aspose.com/docs/display/wordsjava/Document+Tree+Navigation# )
public void recurseAllNodes() throws Exception { // Open a document. Document doc = new Document(getMyDir() + "Node.RecurseAllNodes.doc");<span class="code-comment" style="color: rgb(128, 128, 128);">// Invoke the recursive function that will walk the tree.
traverseAllNodes(doc);
}/**
-
A simple function that will walk through all children of a specified node recursively
-
and print the type of each node to the screen.
*/
public void traverseAllNodes(CompositeNode parentNode) throws Exception
{
// This is the most efficient way to loop through immediate children of a node.
for (Node childNode = parentNode.getFirstChild(); childNode != null; childNode = childNode.getNextSibling())
{
// Do some useful work.
System.out.println(Node.nodeTypeToString(childNode.getNodeType()));<span class="code-comment" style="color: rgb(128, 128, 128);">// Recurse into the node <span class="code-keyword" style="color: rgb(0, 0, 145);">if</span> it is a composite node.
if (childNode.isComposite())
traverseAllNodes((CompositeNode)childNode);
}
}
But the result is same I got only first 7 pages from the document.