Sample Code:
public static Bookmark insertBookmarkAroundNode(Node node, boolean updateLayout)
{
CompositeNode parentNode = node.getParentNode();
if (Objects.isNull(parentNode))
{
return null;
}
String bookmarkName = UUID.randomUUID().toString();
BookmarkStart bookmarkStart = new BookmarkStart(parentNode.getDocument(), bookmarkName);
BookmarkEnd bookmarkEnd = new BookmarkEnd(parentNode.getDocument(), bookmarkName);
parentNode.getChildNodes().insert(0, bookmarkStart);
parentNode.getChildNodes().add(bookmarkEnd);
if (updateLayout)
{
updatePageLayoutForTheDoc((Document)parentNode.getDocument());
}
return bookmarkStart.getBookmark();
}
- From above sample code “updatePageLayoutForTheDoc” ultimately calling “document.updatePageLayout()” of Aspose.words and this particular method is taking around 1 to 2 seconds for execution.
- If Document has too many mathematical equations then this processing time is in too many minutes.
- Do we know how we can optimise this?
- We are using “22.8” version of Aspose, we tried by using latest version of Aspose as well, after upgrading it was taking more time than current one so reverted that.