I am using RenderToBmp(...); to display my PDF pages, in other hand I would like to support hyperlinks my application, I came to Page.Annotation class which do exactly what I need.
What I want to achieve here is to open the URI of the hyperlink as soon as the user touch the hyperlink using getAnnotFromPoint(x,y) but what I could not achieve is to map the device X & Y coordinates touched by the user to the actual PDF point.
I tried the following:
float[] dpoint = new float[2];
float[] ppoint = new float[2];
dpoint[0] = x; x coordinate the user touched
dpoint[1] = y; y coordinate the user touched
// 1.4521009 : is the scale that I used to render the bitmap to view the actual page.
// 1222.0 : is the actual PDF height
Matrix matrix = new Matrix(1.4521009f, -1.4521009f, 0, 1222.0f);
Global.ToPDFPoint(matrix, dpoint, ppoint);
Annotation annotation = pdfPage.GetAnnotFromPoint(ppoint[0], ppoint[1]);
but annotation object is always null, any help of guide would be greatly appreciated.