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. Image for the cookie policy date
close icon

PdfViewer only showing the first two pages

I still have the issue that PdfViewer only shows/renders the first two pages. All remaining pages are shown as white, empty pages.

Current version (installed today), Huawei P20 Pro, Android 9.0 (but was the same with 8.0/8.1). I have referenced Syncfusion.Pdf.Portable.dll and Syncfusion.SfPdfViewer.Android.dll in my app. Note that it's not using Xamarin Forms, but Xamarin.Android (and Xamarin.iOS) separately.

Anything I can do?

EDIT: sometimes it seems to load the remaining pages, if I scroll down and then scroll up to the 2nd/3rd page again. Then the app hangs for a second or so, and then, all of a sudden, all remaining pages are rendered. If I don't scroll up again (and just, let's say, scroll down to page 5), I can wait indefinitely, and nothing happens (i.e. the page stays white).

4 Replies

KK Karthik Krishnaraj Syncfusion Team February 12, 2019 11:27 AM UTC

Hi Olaf, 
 
Greetings from Syncfusion, 
 
I still have the issue that PdfViewer only shows/renders the first two pages. All remaining pages are shown as white, empty pages. 
We are unable to reproduce the issue in our side. We were performing on demand rendering of PDF pages in SfPdfViewer, it will display only the number of pages which will accommodate in the view port of PDF Viewer.  
 
For example: Consider If the PDF Viewer can able to display only 3 pages in the viewport. We will render only 3 pages and rest of the pages will not be rendered. Once you scroll up / scroll down, the previous or next pages will be cleared, and the new 3 pages will be rendered and displayed with respect to the view port. 
 
Please find the simple sample from the below link with which we tried to reproduce the issue. 
 
Sample Link: 
 
On-demand rendering of PDF document in SfPdfViewer helps us to improve performance and memory optimization. 
 
sometimes it seems to load the remaining pages, if I scroll down and then scroll up to the 2nd/3rd page again. Then the app hangs for a second or so, and then, all of a sudden, all remaining pages are rendered. If I don't scroll up again (and just, let's say, scroll down to page 5), I can wait indefinitely, and nothing happens (i.e. the page stays white). 
We could see application hangs for a second while rendering the PDF pages during scrolling and we suspect this to be a defect. We have forwarded the details to our development team for analysis and we will update you with more details on 14th February 2019. 
 
Note: We were unable to reproduce the issue “PDF pages are not rendered over an indefinite time if we don’t scroll up”. Can you please share the modified sample to replicate the issue? It will be helpful for us to analyze further. 
 
Regards, 
Karthik. 



OB Olaf Bartelt February 12, 2019 04:05 PM UTC

Ok, thanks for the sample (which works). I was able to narrow the problem down. The problem is caused by putting the SfPdfViewer inside a NestedScrollView (which I use to be able to hide the Toolbar/ActionBar on scrolling, etc.). If I don't put it inside a NestedScrollView, it performs as in the sample.

Is there any way to get it working inside a NestedScrollView (is there something I can disable on that)? Right now, the SfPdfViewer doesn't seem to notice the scrolling (the page indicator on the right stays at "1" and on the top right, while the pages seem to scroll just fine).


KK Karthik Krishnaraj Syncfusion Team February 13, 2019 09:53 AM UTC

Hi Olaf, 
 
Thank you for your update, 
 
PDFViewer cannot be used in a scrollView as the PDFViewer uses scroll view to scroll the pages. Two scroll views cannot be nested according to the guide lines of scrollview given in the below link, 
 
 
You can find more details about its behavior from below KB, 
 
 
As we said earlier we will update the validation details for “Application hanging issue during scrolling” on 14th February 2019. 
 
Regards, 
Karthik. 



KK Karthik Krishnaraj Syncfusion Team February 14, 2019 04:59 PM UTC

Hi Olaf, 
 
On analyzing the issue “Application hangs for a second while rendering PDF pages on scrolling”, we could see that the delay occurs while retrieving the PDF pages from the android PDFRenderer which is used in the PDF viewer control in Xamarin.Forms Android and Xamarin.Android. We have also provided support to load the PDF document using the third-party library PDFium which is faster in retrieving the pages of the PDF document. Can you please try using the PDFium rendering engine and let us know if you face any other problem? 
 
We have published a KB which illustrates step by step process to use the PDFium rendering engine in our PDF viewer control. So please refer below KB for more details. 
 
 
Regards, 
Karthik. 


Loader.
Live Chat Icon For mobile
Up arrow icon