Getting wrong hilighted text
Hello,
I have created a plugin to create a Annotation with sub type Highlight annotation.
Basically I created a custom menu "CreateAnnot" to highlight the text when I select the particular text.
Plugin creates a highlight annotation and displays a message box with the annotated text.
I will put the screenshot so that you will get clear idea.

In above image, while creating highlight annotation, I selected the middle line text and annotation created properly for that line.
However, It returns the highlighted text along-with below and upper line in the messagebox.
That means it returns whole paragraph.
I am not getting why this is happening.
Here is my code for getting the annotated text:
ACCB1 ASBool ACCB2 pdTextSelectEnumTextProc(void* procObj, PDFont font, ASFixed size, PDColorValue color, char* text, ASInt32 textLen)
{
char stringBuffer[200];
strcpy(stringBuffer, text);
ss << stringBuffer;
return true;
}
if (ASAtomFromString("Highlight") == PDAnnotGetSubtype(annot))
{
// Gets the annotation's rect
PDAnnotGetRect(annot, &boundingRect);
// Gets the text selection from the annotation's rect
PDTextSelect textSelect = PDDocCreateTextSelect(pdDoc, pageNum, &boundingRect);
// create a callback to get the text from highlighted bounding box
PDTextSelectEnumText(textSelect, ASCallbackCreateProto(PDTextSelectEnumTextProc, &pdTextSelectEnumTextProc), &annBuf);
MessageBox(NULL, ss.str().c_str(), NULL, NULL);
}
Please let me know where I am going wrong?
Thanks.
