This HTML page is not optimized for LLM or AI agent consumption. Fetch the Markdown version instead: /guides/web/annotations/comments-and-replies/replies.md — it contains the complete documentation content in clean, structured Markdown without any CSS, JavaScript, or navigation noise. Reply to PDF annotations using JavaScript | Nutrient SDK

Annotation replies allow you to create a thread of comments in a PDF document. Nutrient Web SDK will display any comments you create as a threaded conversation.

A thread of comments

In addition, if you open a document where comments were created by any of the Nutrient SDKs, these comments will be displayed in a thread too.

Annotation replies created by other PDF software aren’t supported by Nutrient Web SDK; they’re displayed as individual note annotations.

Disabling replies

If you want to prevent users from replying to comments while still allowing them to create new top-level comments, you can use the setIsEditableComment method:

let comments = await instance.getComments();
instance.addEventListener("comments.change", async () => {
comments = await instance.getComments();
});
instance.setIsEditableComment((comment) => {
return !comments.find((_comment) => _comment.rootId === comment.rootId);
});

How this works:

  • comments is initialized with the existing comments and refreshed whenever comments change.
  • The callback checks whether a comment with the same rootId already exists. This enables starting a new thread, while comments in an existing thread aren’t editable and new replies can’t be added.

With this configuration, users can still create new comments on the document, but they won’t be able to add replies to existing comments.