Java API to retrieve replies from annotations

Hi Mohan,

While there are no direct API’s to retrieve the replies, you can do this by comparing the object number of the “IRT” key (if any) to the object number of the annotation. For example, you can see the following code:

Obj replyto = annot.GetSDFObj().FindObj("IRT");
if (replyto != null && replyto.IsIndirect())
{
    int parentObjNum = replyto.GetObjNum(); // compare this object number to the parent annotation object number to see if they are the same
}

You can get the parent annotation object number by calling:
int num = annot.GetSDFObj().GetObjNum();

You will need to run this through all the annotations found in the page. To do this, you can refer to the annotation sample linked here.

Please also refer to the following post on how to programmatically create annotation replies: