Xamarin Forms Android - PDF texts blurry while pinch-zooming PdfViewer

Hi,

I only lately found that in real Android devices (not checked simulator yet), pinch-zooming PDF texts exhibits temporary blurring until gesture released (texts become sharp again with fingers lifted after pinch-zoom). iOS has no such problem though. I tried some of the various PdfViewer examples here and still with same phenomenon. I don't know if I have missed anything here.

Thank you.

Francis

6 Replies 1 reply marked as answer

AV Ashokkumar Viswanathan Syncfusion Team September 28, 2020 09:04 AM UTC

Hi Francis, 
 
Greetings from Syncfusion support, 
 
We were able to reproduce the issue “Text in the PDF document becomes blurry while performing pinch zoom” in Xamarin Forms Android. Currently, we are validating the same and will update the further details on September 30th,  2020.    
 
Regards, 
Ashok Kumar Viswanathan. 



AV Ashokkumar Viswanathan Syncfusion Team September 30, 2020 03:06 PM UTC

Hi Francis, 
 
Thank you for your patience, 
 
Regarding the issue, “Text in the PDF document becomes blurry while performing pinch zoom” which have reported in the incident, is the actual behavior of PDF viewer. The PDF pages rendered as high-quality images. Whenever the PDF is zoomed, to maintain the clarity of the pages the PDF page is re-rendered. Since the page images are of high quality, there will be performance delays if we render the pages continuously when the PDF is being zoomed.  
  
So, to avoid the performance issues, the PDF page will be re-rendered only when the zoom operation is completed and as the page is not re-rendered as the page size changes, the page contents become blurry. This is the same behavior found in Adobe reader for Android too. 
 
Regards,  
Ashok Kumar Viswanathan. 


Marked as answer

FT Francis Tang September 30, 2020 03:34 PM UTC

Thank you for your reply. Citing Adobe on Android doesn't necessarily mean all other tools or apps have to suffer the same performance issue unless it is an Android problem which I don't know. Perhaps this matter warrants some further studies.

Best regards,

Francis


AV Ashokkumar Viswanathan Syncfusion Team October 1, 2020 01:52 PM UTC

Hi Francis, 
 
Thank you for your update, 
 
We are using Android’s PdfRenderer.Page to render the PDF pages in our SfPdfViewer control. As the OpenPage API of Android’s PdfRenderer.Page will takes time (200~ 300ms) to open and render the PDF page with high quality . So if we are re-rendering the PDF pages while zooming the page, will makes the UI freezes for particular milliseconds by affecting the performance. 
 
So, to avoid the above performance issues, the PDF page will be re-rendered only when the zoom operation is completed. 
 
Regards, 
Ashok Kumar Viswanathan. 



FT Francis Tang October 1, 2020 02:11 PM UTC

This particular approach employs tiled or grid rendering to reduce latency:

https://pspdfkit.com/blog/2018/rendering-pdfs-on-android/

Francis


AV Ashokkumar Viswanathan Syncfusion Team October 2, 2020 11:54 AM UTC

Hi Francis, 
 
We have already implemented the tile rendering approach to render the PDF pages in our 2020 Volume 2 Main release. We are using Android’s PdfRenderer.Page to render the PDF pages as tiles. However, rendering the PDF pages as tiles will only reduce the memory consumption while rendering, it will not prevent the UI from freezing due to the usage of OpenPage. 
 
Please let me know if you have any concern. 
 
Regards, 
Ashok Kumar Viswanathan. 


Loader.
Up arrow icon