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.
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.
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?
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.