Monday 27 June 2022

Android PDF font is not readable

I'm using react-native-html-to-pdf to convert HTML to PDF and react-native-pdf to view PDF.

For past few days, some of the Android users reported that the generated PDF is not readable. This image below is one the examples:

enter image description here

To debug this issue, we bought a new android 12 phone. First day the PDF was readable in that phone without any issue. After a while, the PDF became unreadable on the new phone also.

On the other side, there are some android phones are facing this issue "partially". In some android phones if we set the html font-weight:bold the PDF is showing perfectly. But unfortunately it's not working in all the phones.

Phones where font-weight:bold is working:

  1. Redmi
  2. Samsung

Phones where we could not find any solution:

  1. Vivo
  2. Oppo

I'm guessing it's happening maybe because of some Android update. After some digging we found out that both react-native-html-to-pdf and react-native-pdf is using WebView for generating and viewing pdf respectively. Could it be because of some Android WebView update causing this issue? I planned create an issue in those library repositories but I think both of them are not actively maintained.

Any suggestion is appreciated.



from Android PDF font is not readable

No comments:

Post a Comment