We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to get the x and y coordinates with respect to PdfViewerControl in MouseUp event?

Platform: WPF |
Control: PdfViewer |
Published Date: August 7, 2018 |
Last Revised Date: August 7, 2018

You can get the coordinates of mouse pointer with respect to PdfViewerControl by using Mouse_Up event of the PdfViewerControl. Refer to the following code snippet.

// Add some labels in XAML page to display the values.


        <syncfusion:PdfViewerControl x:Name="PdfViewer" />

        <Label x:Name="label" Content="X : " Margin="950,5,0,0"/>

        <Label x:Name="label1" Content="Y : " Margin="1100,5,0,0"/>

        <Label x:Name="label2" Margin="1000,5,0,0"/>

        <Label x:Name="label3" Margin="1150,5,0,0"/>


//Wire up the MouseUp event

PdfViewer.MouseUp += PdfViewer_MouseUp;
  private void PdfViewer_MouseUp(object sender, MouseButtonEventArgs e) 


//Get the x and y coordinates

            System.Drawing.Point position = new System.Drawing.Point


                X = (int)e.GetPosition(PdfViewer).X,

                Y = (int)e.GetPosition(PdfViewer).Y


            //Displays the x and y coordinates

            label2.Content = position.X;

            label3.Content = position.Y;


Sample link:



You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon