Free Support Forum - aspose.com

Java 2.0 release - get all bookmarks in a document

I have just upgraded to the Java 2.0 release of Aspose.Words.

Previously the following code returned all bookmarks in a document. Now it seems to only return them for the first section.

com.aspose.words.Document document = new com.aspose.words.Document(new ByteArrayInputStream(uploadFile.getFileData()));
com.aspose.words.Bookmarks bookmarks = document.getRange().getBookmarks();
com.aspose.words.Bookmark bookmark = bookmarks.get("BCOnline_SectionC_Critical_Selection");

So, I tried to loop through all the Sections in the document...

com.aspose.words.Document document = new com.aspose.words.Document(new ByteArrayInputStream(uploadFile.getFileData()));
com.aspose.words.Sections sections = document.getSections();
for (int zz = 0; zz < sections.getCount(); zz++) {
com.aspose.words.Node zznode = sections.get(zz);
System.out.println(zznode.getText());
System.out.println("==========================================");
}

In my development region, I'm running the evaluation version of the product. This version seems now not read all of the document, as the above code output the following message

===============================================================
This document was truncated here because it was created using Aspose.Words in Evaluation Mode.
===============================================================

Please help.

Sad [:(]

We had to change the evaluation mode limitations in this version. Now Aspose.Words in evaluation mode limits the size of the document you can work with to several hundred paragraphs.

Your options are:

  • Work with a smaller document during evaluation.
  • Purchase a license.
  • Request a temporary license from our sales team.