# Do not generate comments when adding annotations

**URL:** https://pdfjs.community/t/do-not-generate-comments-when-adding-annotations/1856
**Category:** Technical Support
**Tags:** pdfjs-express
**Created:** [July 12, 2022, 1:22pm UTC](https://pdfjs.community/t/do-not-generate-comments-when-adding-annotations/1856 "2022-07-12T13:22:35Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![vicente](https://avatars.discourse-cdn.com/v4/letter/v/858c86/32.png) [@vicente](https://pdfjs.community/u/vicente)
#### Post date: [July 12, 2022, 1:22pm UTC](https://pdfjs.community/t/do-not-generate-comments-when-adding-annotations/1856/1 "2022-07-12T13:22:35Z")

</div>

**Which product are you using?**  
PDF.js Express Plus

**PDF.js Express Version**  
UI version: 8.4.1  
Core version: 8.4.0  
Build: NC8xMi8yMDIyfGI0OTc1YjFjZA==  
WebViewer Server: false  
Full API: false

**Detailed description of issue**  
I would like to create annotations without generating these comments:

 ![comments](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/1X/63de1b15f8dc3f3cc80e836e84fcbed473977230.png)

It’s not just about hiding these comments from PDF.js Express, because they also appear in other PDF readers when merging and downloading them. I would really like not to generate them.

Thanks in advance,  
Vicente!

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/1X/ffbcd25c7d423db8d5acd5db201c272f4db306dd.png) [@system](https://pdfjs.community/u/system)
#### Post date: [July 12, 2022, 1:22pm UTC](https://pdfjs.community/t/do-not-generate-comments-when-adding-annotations/1856/3 "2022-07-12T13:22:40Z")

</div>

**Hello, I’m Ron, an automated tech support bot 🤖**

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:
- [XFDF format - In PDF.js Express Web Viewer](https://pdfjs.express/documentation/annotation/xfdf#in-pdf.js-express-web-viewer)
- [Signatures with PDF.js Express](https://pdfjs.express/documentation/signature/overview)
- [Best practices for PDF.js Express - Load documents with loadDocument](https://pdfjs.express/documentation/learn-more/best-practices#load-documents-with-loaddocument)

APIs:
- [PDF.js Express Utilities](https://pdfjs.express/api/utils/index.html#__anchor)
- [Core.DocumentViewer - setInternalAnnotationsTransform(handler)](https://pdfjs.express/api/Core.DocumentViewer.html#setInternalAnnotationsTransform__anchor)
- [Core.Annotations - setCustomDrawHandler(annotationClass, drawHandler [, options])](https://pdfjs.express/api/Core.Annotations.html#.setCustomDrawHandler__anchor)

Forums:
- [Activate SignatureWidgetAnnotation programmatically](https://pdfjs.community/t/activate-signaturewidgetannotation-programmatically/1709/15)
- [PDF.JS Express Merge API and SVG causes “Draft” stamp on exported doc](https://pdfjs.community/t/pdf-js-express-merge-api-and-svg-causes-draft-stamp-on-exported-doc/265/1)
- [Sometime function is not executing even after call with proper parameter](https://pdfjs.community/t/sometime-function-is-not-executing-even-after-call-with-proper-parameter/38/2)

---

<div class="post-metadata">

### Author: ![zserviss](https://avatars.discourse-cdn.com/v4/letter/z/a9a28c/32.png) [@zserviss](https://pdfjs.community/u/zserviss)
#### Post date: [July 12, 2022, 5:43pm UTC](https://pdfjs.community/t/do-not-generate-comments-when-adding-annotations/1856/5 "2022-07-12T17:43:21Z")

</div>

Hi Vicente,

Just confirming that you have found a fix for this issue.

Best Regards,  
Zach Serviss  
Web Development Support Engineer  
PDFTron Systems, Inc.

---

<div class="post-metadata">

### Author: ![vicente](https://avatars.discourse-cdn.com/v4/letter/v/858c86/32.png) [@vicente](https://pdfjs.community/u/vicente)
#### Post date: [July 12, 2022, 5:48pm UTC](https://pdfjs.community/t/do-not-generate-comments-when-adding-annotations/1856/6 "2022-07-12T17:48:52Z")

</div>

Hello, Zach.

No, I didn’t find a solution. I thought so, but I was just filtering the comments, not deleting them.  
That’s why I deleted my previous post.

Thanks,  
Vicente!

---

<div class="post-metadata">

### Author: ![zserviss](https://avatars.discourse-cdn.com/v4/letter/z/a9a28c/32.png) [@zserviss](https://pdfjs.community/u/zserviss)
#### Post date: [July 12, 2022, 7:10pm UTC](https://pdfjs.community/t/do-not-generate-comments-when-adding-annotations/1856/7 "2022-07-12T19:10:47Z")

</div>

Hi Vincente,

After doing some testing I can confirm that setCustomNoteFilter() will only hide notes appearing within our viewer.

A work around to disabling notes from appearing in other PDF viewers would be to merge annotations into the document. This however would remove any edibility to the annotations as they would be essentially baked into the PDF. This involves calling the REST API.

[Here is a guide on this.](https://pdfjs.express/documentation/utils/merge)

[Just for a little more information, WebViewer can flatten a document without a REST API call.](https://pdfjs.express/documentation/advanced/flatten-annotations)

Best Regards,  
Zach Serviss  
Web Development Support Engineer  
PDFTron Systems, Inc.

---

<div class="post-metadata">

### Author: ![vicente](https://avatars.discourse-cdn.com/v4/letter/v/858c86/32.png) [@vicente](https://pdfjs.community/u/vicente)
#### Post date: [July 12, 2022, 8:03pm UTC](https://pdfjs.community/t/do-not-generate-comments-when-adding-annotations/1856/8 "2022-07-12T20:03:49Z")

</div>

Hi, Zach.

I actually already merged the document by calling the REST API. It was exactly after merging the annotations into the document and downloading it that I first saw the comments. So that didn’t help, unfortunately.

Is there a way to add annotation (StampAnnotation, FreeTextAnnotation, FreeHandAnnotation) without creating these comments?

Thanks,  
Vicente!

---

<div class="post-metadata">

### Author: ![zserviss](https://avatars.discourse-cdn.com/v4/letter/z/a9a28c/32.png) [@zserviss](https://pdfjs.community/u/zserviss)
#### Post date: [July 12, 2022, 11:06pm UTC](https://pdfjs.community/t/do-not-generate-comments-when-adding-annotations/1856/9 "2022-07-12T23:06:56Z")

</div>

Hi Vincente,

Unfortunately there is no way to stop the creation of these ‘comments’.

What we are seeing in that side panel is the actual annotation that was created. There is no comment that is actually created, it is just the reference to the annotation.

Could you tell me your specific use case? The easiest work around is to just not show the comment panel.

Best Regards,  
Zach Serviss  
Web Development Support Engineer  
PDFTron Systems, Inc.

---

<div class="post-metadata">

### Author: ![vicente](https://avatars.discourse-cdn.com/v4/letter/v/858c86/32.png) [@vicente](https://pdfjs.community/u/vicente)
#### Post date: [July 13, 2022, 12:22pm UTC](https://pdfjs.community/t/do-not-generate-comments-when-adding-annotations/1856/10 "2022-07-13T12:22:10Z")

</div>

Hello, Zach!

I already hide the comment panel in PDF.js Express, but these comments appear in other PDF readers like Adobe.

After merging the document there are annotations that I want to keep them and also a lot of comments that I want to remove them.

 ![comments_adobe](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/1X/8627c289eb39470859e79ec7662bb73aa32dd184.png)

Thanks,  
Vicente!

---

<div class="post-metadata">

### Author: ![zserviss](https://avatars.discourse-cdn.com/v4/letter/z/a9a28c/32.png) [@zserviss](https://pdfjs.community/u/zserviss)
#### Post date: [July 13, 2022, 2:27pm UTC](https://pdfjs.community/t/do-not-generate-comments-when-adding-annotations/1856/11 "2022-07-13T14:27:45Z")

</div>

Thanks Vincente,

I see. In Adobe when adding annotations, comments on the annotation appear in the comment panel as well.

I would recommend using PDFTron’s WebViewer to flatten annotations so they become part of the PDF and any annotation metadata is lost.

[Here is a guide on migrating.](https://pdfjs.express/documentation/learn-more/pdfjs-express-to-pdftron)

Best Regards,  
Zach Serviss  
Web Development Support Engineer  
PDFTron Systems, Inc.

---

<div class="post-metadata">

### Author: ![vicente](https://avatars.discourse-cdn.com/v4/letter/v/858c86/32.png) [@vicente](https://pdfjs.community/u/vicente)
#### Post date: [July 13, 2022, 3:02pm UTC](https://pdfjs.community/t/do-not-generate-comments-when-adding-annotations/1856/12 "2022-07-13T15:02:25Z")

</div>

Hello, Zach.

If the only solution is to use PDFTron, you can close this issue.

Thank you for your help,  
Vicente.
