> For the complete documentation index, see [llms.txt](https://docs.apryse.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.apryse.com/web/get-started/faq/enable-inline-comment.md).

# How to enable inline commenting feature and right-click annotation menu

World's #1 PDF SDK Library for Web, Mobile, Server, Desktop

## Enable inline commenting feature

Inline commenting is a new feature that allows users to quickly review and catch up on the comment history directly on the annotation. This popup will open when an annotation is selected.

![](https://3532544125-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FX9YnTSKIHvV7m0A36LbO%2Fuploads%2Fgit-blob-bb661807bf2cabdf2a0d8acc6fc925ecfcbdf933%2F8254d76dc062c10a9f523d4b8bdee3c2b3cd9f6a-343x260.png?alt=media)

When this feature is turned on, the annotation menu popup will be opened by right-clicking on an annotation.

{% tabs %}
{% tab title="JavaScript" %}
{% code lineNumbers="true" %}

```js
WebViewer({
  path: '...'
}).then((instance) => {
  // this will turn on the inline commenting feature
  // and will also turn on right-click annotation menu feature
  instance.UI.enableFeatures([instance.UI.Feature.InlineComment]);
})
```

{% endcode %}
{% endtab %}
{% endtabs %}

When this feature is turned off, the annotation menu popup will still be associated with the right click.

{% tabs %}
{% tab title="JavaScript" %}
{% code lineNumbers="true" %}

```js
WebViewer({
  path: '...'
}).then((instance) => {
  // this will turn off the inline commenting feature
  // and will not touch the right-click annotation menu feature
  instance.UI.disableFeatures([instance.UI.Feature.InlineComment]);
})
```

{% endcode %}
{% endtab %}
{% endtabs %}

By default, only text-related annotations will have the inline comment popup open on selected. For the other types of annotations, users will have to right click on the annotation then click Comment to open the inline comment popup. Noted that the notes panel has to stay closed for the inline comment popup to open.

There is an API to define whether the annotation should have inline comment feature enabled on select `instance.UI.setInlineCommentFilter(filterFunc)`

{% tabs %}
{% tab title="JavaScript" %}
{% code lineNumbers="true" %}

```js
// only enable inline comment for free-hand annotations on select
instance.UI.setInlineCommentFilter((annotation) => {
  return annotation.ToolName === Tools.ToolNames.FREEHAND;
});
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Enable right-click annotation menu feature

The annotation menu popup can be converted to a right click. The right click menu will now present different options depending on whether an annotation or the page is right-clicked. Noted that right click on an annotation will also select that annotation.

![](https://3532544125-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FX9YnTSKIHvV7m0A36LbO%2Fuploads%2Fgit-blob-3383776af4df0683a502bac62bb81ea04d870130%2F0d4bed249cdd1c7bdb69fb689263a1d24405dbbb-248x346.png?alt=media)

When this feature is turned on and if the inline commenting feature is turned off, selecting an annotation will no longer show a popup.

{% tabs %}
{% tab title="JavaScript" %}
{% code lineNumbers="true" %}

```js
WebViewer({
  path: '...'
}).then((instance) => {
  // this will turn on the right-click annotation menu feature
  // and will not touch the inline commenting feature
  instance.UI.enableFeatures([instance.UI.Feature.RightClickAnnotationPopup]);
})
```

{% endcode %}
{% endtab %}
{% endtabs %}

When this feature is turned off, the inline commenting feature will be turned off as well if it's on.

{% tabs %}
{% tab title="JavaScript" %}
{% code lineNumbers="true" %}

```js
WebViewer({
  path: '...'
}).then((instance) => {
  // this will turn off the right-click annotation menu feature
  // and will also turn off the inline commenting feature
  instance.UI.disableFeatures([instance.UI.Feature.RightClickAnnotationPopup]);
})
```

{% endcode %}
{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.apryse.com/web/get-started/faq/enable-inline-comment.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
