FindAndInsertBookmark code


#1

Where do i get this FindAndInsertBookmark method


Split document into multiple documents on special character
#2

@sanathjs

Please check the following requested code. We suggest you please read the following article. Hope this helps you.

Find and Replace

public class FindAndInsertBookmark : IReplacingCallback
{

    int i;
    ReplaceAction IReplacingCallback.Replacing(ReplacingArgs e)
    {
        Paragraph para = (Paragraph)e.MatchNode.ParentNode;
        DocumentBuilder builder = new DocumentBuilder((Document)e.MatchNode.Document);
        builder.MoveTo(e.MatchNode);
        builder.StartBookmark("BM_" + i);
        builder.EndBookmark("BM_" + i);
        i++;

        return ReplaceAction.Skip;
    }
}