Adding Instant comments to PDFs in Flutter
Nutrient Flutter SDK provides a user interface (UI) for viewing, adding, and deleting comments in PDF documents. The component, Instant Comments, is available only if you’re using Nutrient Instant.
Comments enable collaborative workflows where multiple users can discuss specific sections of a PDF document without leaving the viewer. Nutrient Instant enables users to receive updates in real time.
Licensing
Comments require a separate component in your Nutrient license. Without this included in your license, you won’t be able to add the functionality of viewing, searching, or adding comments in your application. Contact our Sales team to add comments to your license.
If you’re a new customer, you can try comments without a license key. If you’re an existing customer, ask our Sales team for a trial license if you’re interested.
Terminology
Before starting, here are a few key terms related to comments:
-
Root annotation — The annotation to which all the comments in a single thread are linked.
-
Comment thread — A group of comments associated with the same root annotation.
-
Comment — A single comment added by a user.
Root annotation types
All comments are linked to their respective root annotations. The comments with the same root annotation are part of a single comment thread. There can be two types of root annotations:
-
Markup annotation — You can start a new comment thread by selecting some text and tapping the (
) comment menu item. In this case, the text markup annotation created will act as a root annotation.
-
Comment marker annotation — A comment marker annotation is a new annotation that can be added anywhere in a PDF document and used to start comment threads.
Getting started
The Nutrient Instant Comments tool is disabled by default. If your Document Engine license includes it, you can enable the tool by setting the enableInstantComments
configuration option to true
:
Pspdfkit.presentInstant( serverUrl: 'YOUR_SERVER', jwt: 'YOUR_JWT', configuration: { enableInstantComments: true, } );
Adding a comment
You can add comments in two ways, depending on the type of root annotation.
At the moment, we don’t support the addition of comments or comment marker annotations using programmatic APIs. This is something that might change in the future.
Deleting a comment
Document Engine currently doesn’t expose any APIs for deleting a comment.
![]()
Comment editing isn’t supported in the current version.
For more information on comments, refer to the corresponding Android and iOS guides.