Automatic scrolling to rectangular area of PDF while zoomed in?

Hello,

I am working on a project where the goal is for a user to select items associated with a PDF from an external control, and then an area of the PDF related to the selection is highlighted. Then, the area is zoomed & scrolled to so the user can see the highlight in the SfPdfViewer.

I have been able to add the highlights correctly with Annotations, however scrolling to the rectangular area & zooming into it has proven more difficult.  I can scroll correctly while not zoomed in, but doing it while zoomed has not worked right. 

After zooming in, I have tried both using ScrollToOffset() and setting the horizontal & vertical offsets manually, however both often do not scroll to the correct area and with visually inconsistent results (the same coordinates will scroll differently depending on the previous scroll position).

Is there a better way to zoom & scroll to a rectangular area?

Thank you,

Caroline 



14 Replies

SP SarathKumar Prakash Syncfusion Team December 2, 2021 12:35 PM UTC

Hi Caroline, 
 
Greetings from Syncfusion !! 
 
From our understanding, your requirement is to scroll to the specific rectangle shape annotation present in the document after zoomed in. We have checked and this scenario works fine for us and please find the sample we created to reproduce the scenario from below. 
 
If our understanding is wrong and your requirement is different, please share the following details to analyze more on this case and assist you with the better solution    
 
1. Simple sample/Modify the shared sample to reproduce the issue.   
2. Replication video/procedure to reproduce the issue. 
3. PDF document
 
4. Platform 
5. SfPdfViewer version. 
6. Xamarin Forms version. 
 
Regards, 
Sarath Kumar. 



CG Caroline Greer December 2, 2021 07:52 PM UTC

Thank you for the sample & reply, I have modified it to best replicate the issue.

1) I have modified the behavior of the "scroll to offset" button: in the modified sample's MainPage.xaml.cs, this button will randomly generate a red rectangle annotation on the first page of the PDF. Then, the pdfViewerControl will change its ZoomPercentage to a value that will allow the whole annotation to be viewed close up. Finally, it scrolls to the x,y coordinates of the annotation using ScrollToOffset() - this is the part that is not working correctly for me. The goal is for the entire annotation to be visible in the viewer, however the result is that most of the time, the annotation is either not visible at all or only partially visible, and I have to scroll manually with a swipe to bring it fully into view. 

2) I have attached a .zip containing both a video, and the modified sample. The video is called "AnnotationScrollingProblem.mp4"

3) To decrease file size, I changed the GIS Succinctly.pdf to the 2020 IRS 1040 fillable form, but the behavior is consistent on both. It is included as an embedded resource in the Assets folder

4) I am using the .Android project, testing on a Samsung Galaxy Note 20 Ultra running Android 11.0 & a Google Pixel 3a emulator running Android 8.1. 

5) SfPdfViewer is (I believe) 19.3.0.56

6) Xamarin.Forms version is 5.0.0.2244


Best,

Caroline


Attachment: SyncFusion_Sample_ecb6d849.7z


SP SarathKumar Prakash Syncfusion Team December 3, 2021 02:34 PM UTC

Hi Caroline, 
 
We were able to reproduce the issue, “Programmatical scrolling is not working properly after zoom in”. Currently, we are validating this issue and we will update the further details on December 07, 2021.   
 
Regards, 
Sarath Kumar. 



SP SarathKumar Prakash Syncfusion Team December 8, 2021 07:10 AM UTC

Hi Caroline,  
  
We sincerely regret the inconvenience caused,   
We are still validating on the issue, “Programmatically added annotations appears underneath fillable form fields. We will provide further details on December 10, 2021 without any further delay.     
  
Regards,  
Sarath Kumar.  



SP SarathKumar Prakash Syncfusion Team December 13, 2021 05:40 AM UTC

Hi Caroline,
We sincerely regret the inconvenience caused,
We are still validating on the issue, “ Programmatical scrolling is not working properly after zoom in” due to complexity of the issue. We will provide further details on December 14, 2021 without any further delay.
Regards,
Sarath Kumar.




MP Mohana Priya Raja Syncfusion Team December 14, 2021 06:10 PM UTC

Hi Caroline, 
 
We sincerely regret the inconvenience caused, 
 
Due to complexity still, we are validating the issue Programmatical scrolling is not working properly after zoom in. We will update the further details on December 16th, 2021 without any further delay. 
   
Regards, 
Mohana Priya R 



SP SarathKumar Prakash Syncfusion Team December 16, 2021 04:38 PM UTC

Hi Caroline, 
 
We have confirmed that the issue “Programmatical scrolling is not working properly after zooming in Xamarin.Forms Android platform” is a defect and logged a defect report for this issue. The patch for this issue will be delivered on January 6, 2022.
Please find the feedback link below,     
https://www.syncfusion.com/feedback/31255/android-programmatical-scrolling-is-not-working-properly-after-zooming

Temporary solution for this issue:
Perform zoom-in by one button and scrolling by another button.
 
 
Regards, 
Sarath Kumar. 



CG Caroline Greer December 16, 2021 04:53 PM UTC

Thank you for looking into this, I appreciate your work & consistent updates. I look forward to Jan 6th.



SP SarathKumar Prakash Syncfusion Team December 17, 2021 07:12 AM UTC

Hi Caroline, 
 
We always happy to assist you. 
 
Regards, 
Sarath Kumar. 



MP Mohana Priya Raja Syncfusion Team January 6, 2022 05:13 PM UTC

Hi Caroline,

We sincerely regret the inconvenience caused,
 
 
We are still working on the issue “Programmatical scrolling is not working properly after zoom in” due to the complexity. We will provide the patch for the fix on 13th January, 2022 without any further delay.  
  
 
 
Regards, 
Mohana Priya R 



VD Vikram Devaraj Syncfusion Team January 13, 2022 12:03 PM UTC

Hi Caroline,

We sincerely regret the inconvenience caused,


We are still working on the issue “Programmatical scrolling is not working properly after zoom in” due to the complexity. We will provide the patch for the fix on 20th January 2022 without any further delay. 

  

Regards,

Vikram



SP SarathKumar Prakash Syncfusion Team January 20, 2022 04:08 PM UTC

Hi Caroline,


We sincerely regret the inconvenience caused,
 
We are still working on the issue “Programmatical scrolling is not working properly after zoom in” due to the complexity of this issue. We will provide the patch for the fix on 27th January 2022 without any further delay.  
   
Regards, 
Sarath Kumar. 



SP SarathKumar Prakash Syncfusion Team January 27, 2022 02:49 PM UTC

Hi Caroline, 
  
We sincerely regret for inconvenience caused, 
Due to complexity, we are still working on the fix for the issue “
Programmatical scrolling is not working properly after zoom in” with high priority. We will provide the patch for the fix on February 03, 2022, without any further delay.    

Regards,
Sarath Kumar.
 



SP SarathKumar Prakash Syncfusion Team February 3, 2022 01:16 PM UTC

Hi Caroline,

Your requirement of zooming & scrolling to added rectangle annotation can't be achieved using the scrollTo and Zoom Percentage API alone in sample level. However, we have considered your requirement as a feature and logged a feature request, and you can track the status of this feature implement through below link . This feature is expected to be available in 2022 Volume 1 Main Release.

Feedback Link: https://www.syncfusion.com/feedback/32398/support-to-convert-user-point-coordinates-to-page-point-coordinates-and-zoom-to

Regards,
Sarath Kumar. 
 


Loader.
Up arrow icon