Hi,
We are performing a text search of a PDF and then underlining all words that match the search term. In some cases, the annotation is not underlining the word properly, it can be off to the right.
If I double click the word, the blue box seems to match up to the width and position of the text annotation.
Unfortunately I am unable to share the PDF with you.
This is using version 7.3.2. Some searches do underline correctly in the same document.
This is the method we are using to search and perform the text underline:
private search(searchTerm) {
const { docViewer, CoreControls, annotManager, Annotations } = this.wvInstance;
const searchMode = CoreControls.Search.Mode.PAGE_STOP | CoreControls.Search.Mode.HIGHLIGHT;
const searchOptions = {
fullSearch: true,
onResult: async (result) => {
if (result.resultCode === CoreControls.Search.ResultCode.FOUND) {
if (!result.quads.length) {
return;
}
const textQuad = result.quads[0].getPoints();
const annot = new Annotations.TextUnderlineAnnotation();
annot.StrokeColor = new Annotations.Color(220, 220, 220, 1);
annot.Quads = [textQuad];
annot.PageNumber = result.pageNum;;
annotManager.addAnnotation(annot);
annotManager.drawAnnotations(annot.PageNumber);
}
}
}
docViewer.textSearchInit(searchTerm, searchMode, searchOptions);
}