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

PDFs not rendering correctly on Android

I'm using Syncfusion.Xamarin.SfPdfViewer 17.3.0.27 and Xamarin.Forms 4.4.0.991265.
Some PDF files will render without issue, but some will not render the text correctly.
I have attached two PDF files where most of the text does not render - other elements like borders and images will still render correctly. I have also had cases where some sentences will render but others will not.

When running on Android 5 nothing will render at all until I rotate the screen, then it will render normally after that. On Android 6 and 8 only parts of the document will render, as seen in the attached screenshots.
I have also tried setting Pdfium as the alternate renderer but I didn't see any difference. The files render normally if I open them outside of my app using the default PDF viewer.

Has anyone experienced this issue before? Could it be related to the Android project options? (it works fine on iOS)
I have searched around and found other similar cases but so far none of the solutions have worked for me.

Attachment: examples_a21e6c23.zip

23 Replies

MB Michael Burgess January 2, 2020 11:22 PM

Here is an example Xamarin.Forms project where I can reproduce the issue. It was set up from scratch with nothing changed other than adding the Nuget packages, pdf assets and main page.

I have just tried on an Android 10 device and it renders correctly. I'm not sure if 9 does but 6 and 8 both had the issue.

Attachment: PdfTest_b08765a8.zip


JP Jhansi Priya Ramesh Syncfusion Team January 6, 2020 07:37 AM

Hi Michael, 

Greetings from syncfusion support. 

We could able to reproduce the issue “PDF content is not rendered properly “in our side with Android version 6, 7.  
In android version 5 and 8 the content is rendered but “Performance delay occurs while scrolling/zooming the particular PDF document”. Could you please confirm whether you are facing similar issue at your end? If your issue is different from what we mentioned here, please provide the following details to analyze more on this and assist you with better solution. 
1.       Device specification details with which you are facing the issue 
2.       Video or screenshot representing the issue. 

Meanwhile we have forwarded both the issues to our development team for further analysis and we will provide further details on 8th January 2020. 

Regards, 
Jhansi Priya Ramesh 



MB Michael Burgess January 6, 2020 07:37 PM

We are facing both of those issues as you described. Additionally, on Android 5 the PDF does not render at all until you rotate the screen once.
This only happens if the Syncfusion license is registered in the App.xaml.cs because there is no reminder dialog. If you do not register a license, the PDF will render once the license reminder dialog appears.
This was tested using Syncfusion.Xamarin.SfPdfViewer 17.3.0.27. We have not obtained a license for a newer version yet so we cannot test this with the latest version.


JP Jhansi Priya Ramesh Syncfusion Team January 7, 2020 11:37 AM

Hi Michael, 
 
Thank for you update. You mentioned as “on Android 5 the PDF does not render at all until you rotate the screen once” in your update. But even after registering the license, document is loaded without changing the orientation of the device. Please find the video for your reference from below. 
 
 
We would like to set up web meeting to reproduce the issue in your environment and provide an effective solution.  We will make every effort to have this meeting scheduled on a date and time of your convenience.  
As mentioned earlier, we will provide validation details for the issues PDF content is not rendered properly “and “Performance delay occurs while scrolling/zooming the particular PDF document” on 8th January 2020. 
 
Regards, 
Jhansi Priya Ramesh 



JP Jhansi Priya Ramesh Syncfusion Team January 8, 2020 08:21 AM

Hi Michael, 
 
Please find the details of the issues below, 
 
S.No 
Issue 
Details 
1 
Performance delay occurs while scrolling/zooming the particular PDF document 
We confirm that this issue is a defect. The fix for this issue has been included in our latest weekly release of version 17.4.0.41. Kindly update the PdfViewer to latest version to get your issue resolved. 
2 
PDF content is not rendered properly 
We are internally using native Android renderer named Android.Graphics.Pdf.PdfRenderer  (https://developer.xamarin.com/api/type/Android.Graphics.Pdf.PdfRenderer/) to render the pages from PDF document and displaying the same using SfPdfViewer. After analyzing your PDF document, it seems that this issue occurs in native PdfRenderer API with the Android API 23 (Android 6.0) and Android API 24 (Android 7.0)  as we do not face same issue in Android API 27 (Android 8.0) .   
 
We need to create bug report for this Android API issue in ‘Google Issue Tracker’ to get this resolved. 
 
For that could you please provide us the permission to use the provided PDF document in the bug report? 
3 
PDF document is not rendered until rotating the device in Android version 5 
As requested earlier, we would like to set up web meeting to reproduce the issue in your environment and provide an effective solution.  We will make every effort to have this meeting scheduled on a date and time of your convenience. Kindly provide your convenient time for this meeting.  
 
Regards, 
Jhansi Priya Ramesh 



MB Michael Burgess January 8, 2020 09:30 PM

It appears the rotation issue was related to the performance issue since leaving it alone for long enough without rotating the device causes the "application not responding" message to appear. I have tried it again using 17.4.0.41 and this is now working correctly on Android 5.

Both of those PDFs are publicly available ones I found that I was able to reproduce the issue with. It should be fine to provide them to Google in the bug report.
Thank you for looking into this.


JP Jhansi Priya Ramesh Syncfusion Team January 9, 2020 08:50 AM

Hi Michael, 
 
Thank you for your update. We are glad that your issue with Android 5 version has been resolved in our latest version. 
 
As mentioned earlier, the issue “PDF content is not rendered properly” is not a defect with PdfViewer. It is a bug with native PdfRenderer API with the Android API 23 (Android 6.0) and Android API 24 (Android 7.0). We have logged a bug report in google issue tracker. Please track the status of the bug from below link 
 
 
We will update you once we get solution for this. 
 
Regards, 
Jhansi Priya Ramesh  



MB Michael Burgess January 12, 2020 09:09 PM

While the Android 5 issue was resolved in my test app it appeared there was still some issue in my production app even after updating to 17.0.4.41.
I was able to make some changes in the test app to reproduce the issue in the newer version.
This time it seems the PDF does not render until the the layout is recalculated (such as when rotating the screen).
I have attached a copy of the modified test app where this issue occurs.

Attachment: PdfTest_2_ac884763.zip


GR Gayathri Ramalingam Syncfusion Team January 13, 2020 11:16 AM

Hi Michael 
 
We tried to reproduce the issue “PDF content is not rendered properly” with sample shared by you in v17.4.0.41 in your last update. But we are facing below exception while deploying the application. 
 
 
 
 
 
Meanwhile we tried to reproduce the sample shared by you on 03rd January 2020. It is working as expected and we did not face the mentioned issue. 
 
Could you please provide the executable sample? It will be easy for us to investigate further and assist you with the better solution at the earliest.  
 
With Regards, 
Gayathri R 
 
 
 



MB Michael Burgess January 13, 2020 05:05 PM

I have attached a copy of the apk file built from my second example.


Attachment: pdftest.apk_be0940c7.zip


MB Michael Burgess January 13, 2020 10:51 PM

Hi, I see that Google are asking for an Android Studio project to reproduce the issue, I have created an Android studio project, porting your sample project, that you can upload to them.
Attachment: TestPdfRenderer_eb32ed06.zip


GR Gayathri Ramalingam Syncfusion Team January 14, 2020 06:53 AM

Hi Michael,  
 
Thank you for your update. We have updated the requested details in ‘Google Issue Tracker’. We will update you once we get solution for the issue “PDF content is not rendered properly”.  
 
And also, we were able to reproduce the issue “PDF Document is not loaded in Android API 5.1" in our side and we suspect this to be a defect. We have forwarded this issue to our development team for further analysis and we will update further details by 20-January-2020. 
 
 
With Regards, 
Gayathri R 



JP Jhansi Priya Ramesh Syncfusion Team January 20, 2020 08:33 AM

 
Hi Michael, 
 
We confirm that the issue “PDF Document is not loaded in Android API 5.1” is a defect and logged defect report for the same. We will include the fix for this issue in our weekly release which is scheduled to be rolled out on 4th February 2020.  
   
 
Regards,    
Jhansi Priya Ramesh  



JP Jhansi Priya Ramesh Syncfusion Team February 6, 2020 08:28 AM

Hi Michael, 
 
The fix for the issue PDF Document is not loaded in Android API 5.1” has been included in our latest weekly release of version 17.4.0.47. Kindly update the PdfViewer to latest version to get your issue resolved. Please let us know if any further assistance required. 
 
Regards, 
Jhansi Priya Ramesh 



MB Michael Burgess February 10, 2020 07:43 PM

Hi Jhansi,
Update 17.4.0.47 seems to have resolved the documents not loading in Android 5.

I'm not sure if this was happening before or is a new issue, but I've noticed that if you load a document while in landscape mode the document is very pixelated as if the zoom level was very small. You can test this by loading the Roundup document in my test app in both portrait and landscape and comparing the difference. This is not specific to Android 5, as I was able to reproduce it in 8 as well.


JP Jhansi Priya Ramesh Syncfusion Team February 11, 2020 10:37 AM

Hi Michael, 

We confirm that the issue “Display of PDF document is not proper while loading the document in Landscape orientation” is a defect and logged defect report for the same. We will include the fix for this issue in our weekly release which is expected to be available on 18th February 2020. 

Regards, 
Jhansi Priya Ramesh 



JP Jhansi Priya Ramesh Syncfusion Team February 18, 2020 11:17 AM

Hi Michael, 
 
We have included the fix for the reported issue Display of PDF document is not proper while loading the document in Landscape orientation” in our weekly NuGet release 17.4.0.50. Please find the download link from below,      
 
 
Regards, 
Jhansi Priya Ramesh 



MB Michael Burgess February 18, 2020 10:13 PM

Hi Jhansi,
This appears to have resolved it the first page but subsequent pages are still rendered in low resolution if the document is loaded in landscape orientation. The effect seems worse on Android 6 and 8 than on 5, though it is still noticeable on 5 when viewing the Roundup document in the sample app.


JP Jhansi Priya Ramesh Syncfusion Team February 19, 2020 08:44 AM

 
Hi Michael, 
 
Sorry for the inconvenience caused. 
We confirm that the issue “Display quality of PDF document is not proper while loading the document in Landscape orientation” is a defect in our side and we will include the fix for this issue in our weekly release which is expected to be available on 3rd March 2020. 
 
Regards, 
Jhansi Priya Ramesh 



MB Michael Burgess March 10, 2020 09:11 PM

Hi Jhansi,
This seems to have resolved the render quality issue.


JP Jhansi Priya Ramesh Syncfusion Team March 11, 2020 04:09 AM

Hi Michael, 

Thank you for the update. We will wait to ensure that the provided fix works properly from your end and kindly let us know if you require any further technical assistance. 

Regards, 
Jhansi Priya Ramesh 



MB Michael Burgess March 17, 2020 10:13 PM

Hi Jhansi,
We have installed version 17.4.0.55 into our development app and there is no longer any issue with the render quality in landscape.
Thanks for your assistance.


JP Jhansi Priya Ramesh Syncfusion Team March 19, 2020 01:37 AM

Hi Michael, 

Thank you for the update. We are glad that your issue has been resolved. 

Regards, 
Jhansi Priya Ramesh 


Loader.
Live Chat Icon For mobile
Up arrow icon