Free Support Forum -

Bookmark how to change style, size, spaceAfter

Could you help me to do that? I want change bookmark’s style / font size / spaceAfter

Case ↓

private void drawOverview(Document doc, DocumentBuilder builder, String bookMarkName, MapList dataMapList)
throws Exception {

	String overview = "";
	for (int ii = 0; ii < dataMapList.size(); ii++) {
		overview += dataMapList.get(ii) + "\n";

	Bookmark bookmark = doc.getRange().getBookmarks().get(bookMarkName);
	BookmarkInfoPrinter bookmarkVisitor = new BookmarkInfoPrinter();
	Run run = new Run(doc);
	if (bookmark != null) {


public static class BookmarkInfoPrinter extends DocumentVisitor {
public int visitBookmarkStart(BookmarkStart bookmarkStart) throws Exception {
logger.debug("****" + bookmarkStart.getName() + " ,"+ bookmarkStart.getBookmark().getText());
return VisitorAction.CONTINUE;

	public int visitBookmarkEnd(BookmarkEnd bookmarkEnd) {
		logger.debug("****"+ bookmarkEnd.getName());
		return VisitorAction.CONTINUE;


It seems like you are using Aspose.Words. Would you please confirm the Aspose API that you are using along with its version details? Also, please share sample source document along with expected output so that we can test the scenario in our environment and address it accordingly.