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.
Unfortunately, activation email could not send to your email. Please try again.

Can PdfViewer be used inside a ScrollView?

In Xamarin.Forms, PDF viewer cannot be used in a ScrollView as the  PdfViewer uses ScrollView to scroll the PDF pages. Two ScrollViews must not be nested according to the usage guidelines of the Scrollview given in the following link.

 

https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/layouts/scroll-view#usage

 

If the PdfViewer is used inside a ScrollView not regarding to the previous statement, there will not be any problem in iOS and UWP. But, in Android, only first two pages are rendered and the restare blank. When you scroll, only the parent ScrollView is scrolled. The scroll on the child ScrollView is not detected and the OnScrollChanged event is not raised. 

In Android, on-demand rendering of the pages is used because rendering all the pages of the PDF when it is loaded will be much time consuming based on the page count of the PDF. So, only the first two pages are rendered when the PDF is loaded. The subsequent pages are rendered only when you scroll through the PDF.

 

Since the scroll on the child ScrollView, which is inside the PdfViewer is not detected, the pages other than the first two is not rendered. This is the default behavior of ScrollView that is nested inside another ScrollView in Android platform. The sample in the following link uses two ScrollViews and does not include PdfViewer.

 

Sample link:

http://www.syncfusion.com/downloads/support/directtrac/general/ze/ScrollViewDemo1249624029

 

 

Article ID: Published Date: Last Revised Date: Platform: Control:
8830 06/13/2018 06/13/2018 Xamarin.Android PdfViewer
Did you find this information helpful?
Add Comment
You must log in to leave a comment

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.