How to center current loaded page after zoom in, over the visual viewer?

Hello everybody!

My English is not the best, if I have understood the forum posts correctly, there is no way to center the currently loaded page.

If so, please let me know. Can I somehow access the min and max property of the Horizontal Scrollbar?

Thanks and stay healthy

David

1 Reply 1 reply marked as answer

DD Divya Dhayalan Syncfusion Team January 7, 2021 06:34 PM UTC

Hi David, 
 
Thanks for contacting Syncfusion support. 
 
Based on your update we suspect that your use case scenario is to center the loaded document page, if that so, it is not feasible to load document page to be centric, but we can use PdfViewerControl. ScrollTo(horizontalOffset, verticalOffset) method to scroll to the particular position. And also, we can use PdfViewerControl.ScrollChanged event to get the position values. 
 
UG Link:  
 
Please find the code snippet below to scroll the PDF document in PdfViewerControl,  
  
// Load the PDF document.  
pdfviewer.Load(@"../../Data/Windows Store Apps Succinctly.pdf");  
              
// Occurs when changes are detected in the scroll position.  
pdfviewer.ScrollChanged += Pdfviewer_ScrollChanged;  
  
  
private void Pdfviewer_ScrollChanged(object sender, ScrollChangedEventArgs args)  
{  
            // Get the current offset.  
            verticalOffset = args.VerticalOffset;  
}  
  
private void Scroll_Click(object sender, RoutedEventArgs e)  
{     
            // Scroll to the specified offset.  
            pdfviewer.ScrollTo(verticalOffset + 20);  
}  
  
  
Can you kindly explain us more about on your requirement and the use case scenario in details? This information will be helpful for us to analyze more from our side and provide you a better solution.  
  
Regards,  
Divya 


Marked as answer
Loader.
Up arrow icon