.
.
.
private void PdfViewer_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
_userClick = true;
_userClickPoint = e.GetPosition(_pdfViewer); //X and Y of mouse position *within viewer*
}
private void PdfViewer_MouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
Page currentPage;
if (_userClick)
{
double x = _userClickPoint.X;
double y = _userClickPoint.Y;
_pdfViewer.ConvScreenPtToPagePt(ref x, ref y, _pdfViewer.CurrentPageNumber);
currentPage = _pdfDocument.GetPage(_pdfViewer.CurrentPageNumber);
try
{
int annot_num = currentPage.GetNumAnnots();
for (int i = 0; i < annot_num; ++i)
{
Annot parsingAnnot = currentPage.GetAnnot(i);
if (parsingAnnot.IsValid() == false || parsingAnnot.GetType() !=
Annot.Type.e_Highlight) continue;
Rect box = parsingAnnot.GetRect();
if (box.Contains(x, y))
{
//*WE HAVE A MATCHING ANNOTATION*
_annotFromClick = new Annot(parsingAnnot);
//FROM THIS POINT I CAN RUN MY BUSINESS LOGIC WITH A HANDLE ON THE ANNOTATION THAT WAS CLICKED ON
}
}
}
catch { //no annots on page