packages.flutter icon indicating copy to clipboard operation
packages.flutter copied to clipboard

[Android] Blurry/Broken PDF Text Since Flutter 3.27.X

Open estien opened this issue 10 months ago • 5 comments

Describe the bug PDF rendering quality has significantly degraded on Android devices since Flutter 3.27.X. PDFs now display with blurry, pixelated text that becomes increasingly unreadable when zooming in. This appears to be a regression in the PDF rendering engine affecting text clarity and resolution.

To Reproduce Steps to reproduce the behavior:

  1. Deploy the example app from the package repository
  2. Open any PDF file using the basic PDF viewer example
  3. Try to read the text and zoom in
  4. Observe the blurry, pixelated text rendering

Expected behavior PDF text should render crisp and clear at all zoom levels, maintaining readability and proper resolution scaling. Text should remain sharp when zooming in, similar to the rendering quality in versions prior to Flutter 3.27.X.

Screenshots

Image

Smartphone (please complete the following information):

Device: Samsung Galaxy S10 OS: Android 12 Flutter Version: 3.27.3 pdfx Version: 2.8.0

Additional context

This issue appears to be Android-specific The problem is consistent across different PDF files Text rendering quality is particularly degraded when zooming in The issue began appearing specifically after updating to Flutter 3.27.X

estien avatar Feb 06 '25 07:02 estien

We are observing the same issue after upgrading to 3.27. It does not affect the emulator but only actual devices.

twklessor avatar Feb 10 '25 13:02 twklessor

I got the exact same problem.

jgaugeritc avatar Feb 10 '25 14:02 jgaugeritc

I have the same problem. Has anyone found a temporary solution?

mcagrigoktas avatar Feb 10 '25 14:02 mcagrigoktas

#543 I think the issue is related to this, when will this pr will be approved?

ZoftPranav avatar Feb 11 '25 05:02 ZoftPranav

Looks like this issue is related to impeller renderer becoming the default from flutter v3.27. The only quick fix I can think of (and it WORKS!) is to override the default setting and use skia like it was the case with previous flutter versions.

Temporary solution

Add the following meta tag in your AndroidManifest.xml:

        <meta-data
            android:name="io.flutter.embedding.android.EnableImpeller"
            android:value="false" />

Refer: https://docs.flutter.dev/perf/impeller

Don't forget to remove this meta tag after https://github.com/ScerIO/packages.flutter/pull/543 is merged and a new release is available since support for skia will be dropped soon afaik

coder-with-a-bushido avatar Feb 11 '25 05:02 coder-with-a-bushido