Hey tgordon,
I set the contents using highlight.setContents(getSelectedText()). But you can see that the opacity of default pdfjs highlight annotation is less than the programatically created highlight annotation.
And when I click the edit button of default pdfjs highlight annotation, it show me a comment field and I can not edit the actual content but in self created annotation it give me the access to edit my actual content. Again when I drag the text of default pdfjs highlight annotation from PDF it edit the actual content in the right side bar. But when I drag the text of self created highlight annotation from pdf it do not edit my actual content, it create another text over my content.
Here is my code snippet.
const highlight = new Annotations.TextHighlightAnnotation();
highlight.Author = annot.Author;
highlight.Hidden = false;
highlight.Quads = annot.Quads;
highlight.StrokeColor = new Annotations.Color(255, 176, 176, 1);
highlight.PageNumber = annot.getPageNumber();
highlight.Locked = false;
highlight.setContents(getSelectedText());
highlight.setCustomData("trn-custom-data", "Test Data");
highlight.Subject = 'Highlight';
annotManager.addAnnotation(highlight, true);
annotManager.drawAnnotations(1);
})