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: GitHub - groupdocs-annotation/GroupDocs.Annotation-for-Java: GroupDocs.Annotation for Java examples, plugins, and showcase
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.

1 Like

The issues you have found earlier (filed as ANNOTATIONJAVA-1334) have been fixed in this update. This message was posted using Bugs notification tool by vitaliy.rezchikov