Skip to main content
Participant
September 16, 2026
Question

How to insert a diy annot at caret position, there doesn't seem to be a relevant function in the SDK.

  • September 16, 2026
  • 3 replies
  • 23 views

now i am developing a diy annotation which should be inserted at caret position,that is similar to existing Caret annotation.
The challenge is to get the caret position. 
Thank you in advance for any feedback😀.

    3 replies

    Amal Jaiswal
    Community Manager
    Community Manager
    September 16, 2026

    Hello @Enthusiastic_problem2073

    Thanks for the question. This is an interesting one.

    A couple of things that would help narrow this down: which SDK/API are you working in — the Acrobat JavaScript API (for comment/annotation scripting inside Acrobat), the Acrobat Plug-in/PDF Library SDK (native C/C++ development), or a third-party PDF SDK? The available position-related methods differ quite a bit from each other.

    In general, for the Acrobat JavaScript API specifically, there isn't a direct method that returns a live text-insertion caret position the way a text editor would expose a cursor location. The built-in Caret annotation type is really just a rectangle (rect) placed at a given position, not something derived automatically from where the user's cursor is.

    The common workaround developers use is to derive the position from something else that's already anchored to the text, most often the rect or quads of a StrikeOut or Highlight annotation the user has already placed, and then create your custom annotation relative to that. There's a community example of this approach for placing a Caret annotation right before a StrikeOut, which might be adaptable to your case: Place a caret before strikeout and copy contents.

    If you can confirm which SDK you're targeting, we (or one of our developer community experts) can point you toward something more specific. This might also get better traction on our dedicated Acrobat SDK board rather than the general Questions board: Acrobat SDK community.

    Regards,
    Amal

    Participant
    September 17, 2026

    Thx for your reply😀
    I mentioned the build-in Caret annotation is because it has 2 scenarios
    1. there's no blinking caret in pageview,you trigger the Caret button ,then you need to Click on a specific spot between char to insert the Caret annot
    2. if there's already a blinking caret exist,The annotation appeare the instant the button is triggered( you don’t need to click anymore)
    The second scenarios is my target. I need to know how to get the position of blinking caret at dev coordinate🤔

    Amal Jaiswal
    Community Manager
    Community Manager
    September 17, 2026

    Hello @Enthusiastic_problem2073

    Thanks for clarifying, that's a clear distinction between the two scenarios.

    For scenario 2, I don't have confirmation that there's a public API that exposes the coordinates of an already-active blinking text-edit caret. That behavior appears to be internal to Acrobat's text-edit mode itself, and I couldn't find anything in the Acrobat JavaScript API or plug-in SDK documentation that surfaces a live caret/cursor position the way you're describing.
    Since this is a fairly deep SDK question, I'd suggest posting this directly on our Acrobat SDK board, where developers with plug-in-level experience are more likely to have run into this.

    Regards,
    Amal


    ^AD