Articles in this section
Category / Section

Can PdfViewer be used inside a ScrollView in Xamarin.Android PDFViewer?

1 min read

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 rest will be 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:

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

 

 

Conclusion

I hope you enjoyed learning about how can PdfViewer be used inside a ScrollView in Xamarin.Android PDFViewer.

You can refer to our Xamarin.Android PDFViewer feature tour
page to know about its other groundbreaking feature representations. You can also explore our Xamarin.Android PDFViewer documentation
to understand how to create and manipulate data.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied