Detect Scrolling on the viewer

I have a use case where I need to display two pdfviewers with same content and these controls need to be in sync all the time. If I scroll up or down on pdfviewer1, after user is done with his or her action (moving up or down), I need to show the same region and page on pdfviewer2. Is this possible? There is page change event but I dont see any specific event for detecting the scroll up and end. Can you please help?


5 Replies

SP SarathKumar Prakash Syncfusion Team January 18, 2022 10:28 AM UTC

Hi sri velic,

Currently our PdfViewer does not have any event to detect scrolling.But you can take the HorizontalOffset and VerticalOffset from PdfViewer1 and scroll to that offset in PdfViewer2 by using below code
 
pdfViewerControl2.ScrollToOffset(pdfViewerControl1.HorizontalOffset, pdfViewerControl1.VerticalOffset); 
 
Regards,
Sarath Kumar.
 



SV sri velic January 23, 2022 05:27 PM UTC

Hi Sarathkumar Prakash,


Where can I add the above code though? We need to know that the user moved to a different location/region on pdfviewer. Is there any event to track the current region?


-Srinu



SP SarathKumar Prakash Syncfusion Team January 24, 2022 08:26 AM UTC

Hi sri velic,

SfPdfViewer does not have event to track the current region.But you can bind the pdfviewer1 properties(HorizontalOffset,VerticalOffset,ZoomPercentage) to pdfViewer2.So that you can show the same region of pdfviewer1 in pdfviewer2.We have created simple sample in which we have bind the HorizontalOffset,VerticalOffset properties of pdfviewer1 to pdfviewer2.
Please find the sample from below link,
https://www.syncfusion.com/downloads/support/directtrac/general/ze/sample183977197.zip  
Regards,
Sarath Kumar.
 



SV sri velic February 6, 2022 09:38 PM UTC

Awesome example. Very helpful. Thank you Sarath Kumar.



SP SarathKumar Prakash Syncfusion Team February 7, 2022 05:10 AM UTC

Hi sri velic,

We are always happy to assist you. Please get in touch with us if you would require any further assistance.  
  
Regards,
Sarath Kumar.
 


Loader.
Up arrow icon