GcDocs PDF Viewer provides users with the ability to add text annotations and their replies as comments in PDF documents. These comments are very useful to hold some discussion, ask questions or add important information. The Text Annotation Reply tool can be used to add replies to text annotations in comments panel, add sticky notes to the document, view all comments in comments panel, edit or delete comments and assign their review status.
Once a text annotation is added to a document, it can be viewed in the comments panel to add a reply to it as shown below:
Once the comments panel is visible, users can see all the text annotations and their replies. To view the comments panel, choose either of the following:
Besides the comments panel, these replies are also visible below the original text annotation in the PDF document.
The Text Annotation Reply tool is hidden by default. However, it can be enabled by using addReplyTool method as shown below:
Index.cshtml |
Copy Code
|
---|---|
viewer.addReplyTool(); |
The Text Annotation Reply tool can also be enabled in expanded state which displays the comments panel, by default. The below code can be used for the same:
Index.cshtml |
Copy Code
|
---|---|
viewer.addReplyTool("expanded");
|
Note: To use Text Annotation Reply tool, SupportApi should be configured (as it allows editing a PDF document). The tool will work in read-only mode if SupportApi is not configured. The read-only mode is particularly useful to view all comments in comments panel.
While replying to a text annotation, the author name is displayed as 'Anonymous' by default. However, the desired author name can be set in following ways:
Index.cshtml |
Copy Code
|
---|---|
var viewer = new GcPdfViewer("#root", { userName: 'Jaime Smith', supportApi: 'api/pdf-viewer' }); |
A text annotation or reply can be edited by clicking on it in the comments panel as shown below:
A text annotation or reply can be deleted by clicking on Actions | Delete
Note: To delete the parent annotation and retain its replies, use the properties panel of Annotation Editor on the left sidebar. Otherwise, all its replies are removed as well.
You can also add review status to a text annotation in the comments panel by clicking on Actions | Status:
The status is added as an icon to the comment and displays assignee's name when hovered upon. The review status is also visible in the PDF document below the original comment. A user can assign only 1 status to a text annotation but multiple users can assign status to a text annotation.
You can also assign status for a text annotation programmatically, by setting following properties: 'title' 'state', 'stateModel', 'referenceType', 'referenceAnnotationId'. The below example code shows how to add a reply to text annotation with id '6R' and assign 'Completed' status:
Index.cshtml |
Copy Code
|
---|---|
function addCompletedStatus() { viewer.findAnnotation("6R").then(function (searchResult) { var userName = "Jane Donahue"; var replyAnnotation = viewer.cloneAnnotation(searchResult[0].annotation); replyAnnotation.title = userName; replyAnnotation.stateModel = 'Review'; replyAnnotation.state = 'Completed'; replyAnnotation.referenceType = 'R'; replyAnnotation.referenceAnnotationId = '6R'; replyAnnotation.contents = 'Status Completed set by ' + userName; viewer.addAnnotation(0, replyAnnotation); }); } |
You can also add a sticky note anywhere in the PDF document by using context menu. Once it is added, enter some text and click 'Done' in its built-in text editor to retain the note.
You can also add replies to it, set author name, modify or delete a note and assign its review status in the comments panel.