Thanks for elaborating further.
The editor application uses to convert PDF pages into images and displays converted images in HTML Canvas for further operations (e.g. stamping, annotating, commenting, etc.). This is for demonstration of some features which can be implemented using Aspose.PDF for .NET in code-bhind.
Regarding your original requirement (i.e. draw boxes on the screen with mouse and capture the coordinates to use in PDF for adding text), mouse coordinates can be captured using following formula. Please note that
pdfx is x coordinate inside PDF file and
pixelX is mouse X coordinates over screen.
pixelX = (pdfX/72)* DPI
pdfX = pixelX * 72 / DPI
Where DPI is screen resolution and usually its 96 can be calculated programmatically.
float dpiX, dpiY;
Graphics graphics = this.CreateGraphics();
dpiX = graphics.DpiX;
dpiY = graphics.DpiY;
Console.WriteLine("DPIx = " + dpiX + " DPIy " + dpiY);
You can notice in the above code that resolution is considered as 96dpi which cannot be considered for sure in case of the web applications as they can be used on screens with different resolutions. Nevertheless, an investigation ticket as PDFNET-36826 has already been logged in our issue tracking system to determine whether this functionality can be achieved or not i.e. Convert mouse coordinates to pdf units.
We have linked the ticket ID with this forum thread so that you will be notified as soon as it is resolved. Please be patient and spare us some time. In case you need further assistance or have any other inquiry, please feel free to let us know.