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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

PDFs not rendering correctly on Android

Thread ID:

Created:

Updated:

Platform:

Replies:

150353 Jan 3,2020 03:55 AM UTC Mar 19,2020 06:37 AM UTC Xamarin.Forms 23
loading
Tags: PdfViewer
Michael
Asked On January 3, 2020 03:55 AM UTC

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

Michael
Replied On January 3, 2020 04:22 AM UTC

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

Jhansi Priya Ramesh [Syncfusion]
Replied On January 6, 2020 12:37 PM UTC

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 


Michael
Replied On January 7, 2020 12:37 AM UTC

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.

Jhansi Priya Ramesh [Syncfusion]
Replied On January 7, 2020 04:37 PM UTC

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 


Jhansi Priya Ramesh [Syncfusion]
Replied On January 8, 2020 01:21 PM UTC

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 


Michael
Replied On January 9, 2020 02:30 AM UTC

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.

Jhansi Priya Ramesh [Syncfusion]
Replied On January 9, 2020 01:50 PM UTC

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  


Michael
Replied On January 13, 2020 02:09 AM UTC

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

Gayathri Ramalingam [Syncfusion]
Replied On January 13, 2020 04:16 PM UTC

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 
 
 
 


Michael
Replied On January 13, 2020 10:05 PM UTC

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


Attachment: pdftest.apk_be0940c7.zip

Michael
Replied On January 14, 2020 03:51 AM UTC

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

Gayathri Ramalingam [Syncfusion]
Replied On January 14, 2020 11:53 AM UTC

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 


Jhansi Priya Ramesh [Syncfusion]
Replied On January 20, 2020 01:33 PM UTC

 
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  


Jhansi Priya Ramesh [Syncfusion]
Replied On February 6, 2020 01:28 PM UTC

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 


Michael
Replied On February 11, 2020 12:43 AM UTC

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.

Jhansi Priya Ramesh [Syncfusion]
Replied On February 11, 2020 03:37 PM UTC

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 


Jhansi Priya Ramesh [Syncfusion]
Replied On February 18, 2020 04:17 PM UTC

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 


Michael
Replied On February 19, 2020 03:13 AM UTC

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.

Jhansi Priya Ramesh [Syncfusion]
Replied On February 19, 2020 01:44 PM UTC

 
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 


Michael
Replied On March 11, 2020 02:11 AM UTC

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

Jhansi Priya Ramesh [Syncfusion]
Replied On March 11, 2020 09:09 AM UTC

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 


Michael
Replied On March 18, 2020 03:13 AM UTC

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.

Jhansi Priya Ramesh [Syncfusion]
Replied On March 19, 2020 06:37 AM UTC

Hi Michael, 

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

Regards, 
Jhansi Priya Ramesh 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon

Live Chat Icon For mobile
Live Chat Icon