#region Constructor
public Form1()
{
InitializeComponent();
//Load the PDF file.
pdfViewerControl1.Load("../../Data/HTTP Succinctly.pdf");
//Wire the `PageClicked` event.
pdfViewerControl1.PageClicked += PdfViewer_PageClicked;
}
#endregion
#region Event
void PdfViewer_PageClicked(object sender, PageClickedEventArgs args)
{
//Find the page number in which the mouse clicks occurred.
int currentPage = args.PageIndex;
//Find the mouse position on above the document page
System.Drawing.PointF mousePosition = args.Position;
}
#endregion |
Hi Matthew,Thanks for contacting Syncfusion support.In PdfViewerControl by using PageClicked event we can get the current clicked position and page index of the PDF page. Please find the code snippet below to use the PageClicked event.
#region Constructorpublic Form1(){InitializeComponent();//Load the PDF file.pdfViewerControl1.Load("../../Data/HTTP Succinctly.pdf");//Wire the `PageClicked` event.pdfViewerControl1.PageClicked += PdfViewer_PageClicked;}#endregion#region Eventvoid PdfViewer_PageClicked(object sender, PageClickedEventArgs args){//Find the page number in which the mouse clicks occurred.int currentPage = args.PageIndex;//Find the mouse position on above the document pageSystem.Drawing.PointF mousePosition = args.Position;}#endregionRefer to the UG Link: https://help.syncfusion.com/windowsforms/pdf-viewer/how-to/get-mouse-position#page-clicked-eventCurrently, we are analyzing to add an image at a given position in PDFpages. We will update you with further details on 4th Aug, 2020.Regards,Vikas