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.

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

    Translate
    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🤔

    Translate
    Amal Jaiswal
    Community Manager
    Community Manager
    September 17, 2026

    Hello @Enthusiastic_problem2073

    I hope you are doing well, and thanks for clarifying the difference between the two scenarios. 

    Since your question is about working at the plug-in level, the best place to get help is our Acrobat SDK board. Developers there have experience with the SDK and are more likely to help you better on this.

    When you post there, it would help if you include both scenarios, what you expect to happen, and what you see instead.

    Regards,
    Amal


     

    Translate