Select Annotation programmatically with Rect box

I can select an annotation (stamp) programmatically however I can’t manage to display the bounding box of that annotation.

I tried .getRect() , .getActiveAppearanceState() but not working.

Preferred language: Swift

Thanks in advance.

Hello,

Could you please elaborate further on what you are trying to achieve by displaying the bounding box of the annotation? Perhaps a screenshot would help clarify.

Thanks!

Hello,

I’m trying to display the edit “bounding box” of an annotation programatically without having to click on the annotation.

Here is the screenshot. The “bounding box” that I mention refers to the rectangle with the blue dots.

Thanks in advance for your help.

Thank you for providing me with further details of what you are trying to accomplish.

You can create that rect by calling the GetSreenRectForAnnot function from the PDFViewCtrl Class. Please take a look at the API from here for more details:
https://www.pdftron.com/api/ios/pdftron/Classes/PTPDFViewCtrl.html#/c:objc(cs)PTPDFViewCtrl(im)GetScreenRectForAnnot:page_num:

Thanks,

Thank you for your reply.

Sorry for not being clear in my question. I would like to simulate a click on an annotation programmatically. Which means that the “Edit box” over the annotation (like in the photo) is displayed and the user can edit the size and move the annotation.

The getScreenRect only gives us the coordinates of the annotation’s Rect but doesn’t show the “Edit box”.

How can I display that “Edit Box” please ?