How to fixed free text annotation position

I am creating free text annot using below code sample (in java). If i open this pdf in some pdf viewer, i can move this free text. Is there any way to fixed this free text position so that i cannot move this free text in any pdf viewer?

        FreeText textAnnot = FreeText.create(doc, widget.getRect());
        String contents = "Content goes here";
        textAnnot.setTextColor(new ColorPt(), 1);
        textAnnot.setLineColor(new ColorPt(), 1);
1 Like

Hi Imran,

Do you still require the free text to remain an annotation? If not, you can simply flatten the annotations down and this will prevent it from being movable in any pdf viewer. Please see the documentation for more info:

1 Like