We're sorry GroupDocs doesn't work properply without JavaScript enabled.

Free Support Forum - groupdocs.com

Annotate document is not working aptly

First test case: I annotate a docx file with text redaction and the document wasn’t annotated, and the annotation doesn’t appear on the screen. Actually, we can see just the annotation square limitation, but it grows until touch the left and bottom sides.

Second test case: I annotate a docx file with text redaction, the document was annotated but without comment. The problem with the square limitation happened in this test too.

Git project: https://github.com/groupdocs-annotation/GroupDocs.Annotation-for-Java
Git branch: master
Git revision: aeb3d5d9
Browser: Chrome Version 92.0.4515.159 (Official Build) (64-bit)
SO: Windows 10
Document:
First test case: document-was-not-annotated.png (197.2 KB)
Second test case: document-was-anotated-without-comment.png (260.4 KB)
bug 7685.docx (12.2 KB)
document-was-not-annotated.png (197 KB)
document-was-anotated-without-comment.png (223 KB)

@john.mcqueide
We’ve created an issue in our internal issue tracking system with ID ANNOTATIONJAVA-1334. You’ll be notified here in case of any update.

1 Like

@vitaliy.rezchikov

I figure out the issue cause. The TextRedactionAnnotator doesn’t overwrite the annotateWord(), so when it is called it runs the parent annotateWord() method which is in turn uses highlightAnnotation property that doesn’t have the comments set.

Fix suggestion to the Demo Project

public class TextRedactionAnnotator extends TextHighlightAnnotator {
    ...
    @Override
    public AnnotationBase annotatePdf() {
        textRedactionAnnotation = (TextRedactionAnnotation) initAnnotationBase(textRedactionAnnotation);
        return textRedactionAnnotation;
    }

    //NEW CODE
    @Override
    public AnnotationBase annotateWord() {
        return annotatePdf();
    }
    ...
}

public class TextHighlightAnnotator extends AbstractTextAnnotator {
    ...
    @Override
    public AnnotationBase annotateWord() {
        highlightAnnotation = (HighlightAnnotation) initAnnotationBase(highlightAnnotation);
        return highlightAnnotation;
    }
    
    @Override
    public AnnotationBase annotatePdf() {
        return annotateWord();
    }
    ...
}

@john.mcqueide

Good to know that the issue is fixed.