Skip to content

SfPdfViewer - Read-only text form field value is displayed twice on top of the native page rendering (related to #2530) #2564

Open

Description

@MobiliteDev

Bug description

When opening a PDF form with ReadOnly AcroForm fields whose values are stored in their appearance streams, the value of a read-only text field is displayed twice:

  1. once by the document/page rendering layer (the PDF page paints the value from the field appearance stream /AP /N),
  2. once by the Flutter form field widget that SfPdfViewer stacks on top of the page (FormFieldContainer > PdfTextBox > TextFormField, which shows the field text even when readOnly).

The two renderings are slightly offset, which gives the "duplicated characters" of the attached screenshot (field nom shows "TESTTEST").

Relation to #2530 ("Read-only form fields appear duplicated...", confirmed as a defect and reported fixed in v33.2.13+1 - "avoid creating overlay widgets for read-only or flattened fields"): the duplication still occurs in the latest version 35.1.40 with our document. Difference with the #2530 scenario: that fix covers read-only fields created by the Flutter PDF library itself (fields saved with PdfFlattenOption.none, values set through the viewer API). In our document, the frozen values were NOT produced by the library - nom-344 is a plain PDF widget whose value exists ONLY in its appearance stream, flattened by a third-party tool, and the signature fields have NO appearance stream at all while a signature image is painted in the page content. It seems the #2530 fix relies on library-side state and does not cover widgets authored externally with appearance-only frozen values.

Platforms: reproduced on Android 15 (physical device Fairphone FP4, arm64); NOT observed on Windows desktop with the same code and the same PDF.

Other viewers (Adobe Acrobat Reader, Chrome pdfium, Android built-in "Files" preview) display the value once - correct.

Steps to reproduce

  1. Create a minimal Flutter app with syncfusion_flutter_pdfviewer 35.1.40 (Flutter 3.47.7; same duplication observed with 33.1.49 / 32.2.9 / 32.1.19 on Flutter 3.38.10).
  2. Load the attached PDF (pdf_bugged.pdf, structure detailed below) with a bare SfPdfViewer.file(...).
  3. On Android 15 (Fairphone FP4), observe the read-only text field nom-344 on page 1: the value "TEST" is painted twice (slight offset).

PDF structure (2 pages, 3 fields):

  • nom-344 (/Tx, /Ff bit 1 = ReadOnly, /V = "TEST"): the value exists ONLY in the widget appearance stream (/AP /N contains (TEST) Tj). The page content stream does not contain any (TEST) Tj.
  • signatureA|74|205|165|91|1, signatureB|74|142|175|87|2 (/Btn, ReadOnly, NO /AP): a signature image is painted in the page content stream (x=74) while the widget rect is at [74, 546, 239, 637] - partial overlap with painted content.
  • AcroForm dictionary: no /NeedAppearances, /DA present.

Code sample

Code sample
import 'dart:io';

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:path_provider/path_provider.dart';
import 'package:syncfusion_flutter_pdfviewer/pdfviewer.dart';

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  runApp(const ReproApp());
}

class ReproApp extends StatelessWidget {
  const ReproApp({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      title: 'SfPdfViewer readonly formfield duplication',
      home: ReproPage(),
    );
  }
}

class ReproPage extends StatefulWidget {
  const ReproPage({super.key});

  @override
  State<ReproPage> createState() => _ReproPageState();
}

class _ReproPageState extends State<ReproPage> {
  File? _file;

  @override
  void initState() {
    super.initState();
    WidgetsBinding.instance.addPostFrameCallback((_) => _loadPdf());
  }

  Future<void> _loadPdf() async {
    // The asset is the PDF reproducing the issue (pdf_bugged.pdf).
    final Directory dir = await getTemporaryDirectory();
    final File target = File('${dir.path}/pdf_bugged.pdf');
    final ByteData data = await rootBundle.load('assets/pdf_bugged.pdf');
    await target.writeAsBytes(
      data.buffer.asUint8List(data.offsetInBytes, data.lengthInBytes),
    );
    setState(() => _file = target);
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      // nom-344 = "TEST" is displayed twice (page rendering + form overlay).
      body: _file == null
          ? const Center(child: CircularProgressIndicator())
          : SfPdfViewer.file(
              _file!,
              onDocumentLoaded: (PdfDocumentLoadedDetails details) {
                debugPrint('loaded, fields: ${details.document.form.fields.count}');
              },
            ),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration Image

pdf_bugged.pdf

Stack Traces

Stack Traces
No stack trace - silent visual rendering issue, not a crash.

On which target platforms have you observed this bug?

Android

Flutter Doctor output

Doctor output
[√] Flutter (Channel stable, 3.47.7, on Microsoft Windows [version 10.0.26200.9448], locale fr-FR) [565ms]
    • Flutter version 3.47.7 on channel stable at C:\Users\pnv_aca.PROGINOV\fvm\versions\3.47.7
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision abaf9c5237 (5 days ago), 2026-10-08 09:51:21 -0700
    • Engine revision deb287481e
    • Dart version 3.13.5
    • DevTools version 2.60.0
    • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-native-assets, enable-record-use, enable-swift-package-manager, omit-legacy-version-file, enable-lldb-debugging, enable-uiscene-migration

[√] Windows Version (Windows 11 or higher, 25H2, 2009) [4,1s]

[!] Android toolchain - develop for Android devices (Android SDK version 36.1.0) [6,1s]
    • Android SDK at C:\Users\pnv_aca.PROGINOV\AppData\Local\Android\sdk
    • Emulator version 36.6.11.0 (build_id 15507667) (CL:N/A)
    • Platform android-36.1, build-tools 36.1.0
    • Java binary at: C:\Program Files\Microsoft\jdk-21.0.10.7-hotspot\bin\java
      This JDK is specified in your Flutter configuration.
      To change the current JDK, run: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version OpenJDK Runtime Environment Microsoft-13106404 (build 21.0.10+7-LTS)
    ! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses

[√] Chrome - develop for the web [197ms]
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop Windows apps (Visual Studio Enterprise 2026 18.5.1) [195ms]
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\18\Enterprise
    • Visual Studio Enterprise 2026 version 18.5.11716.220
    • Windows 10 SDK version 10.0.26100.0

[√] Connected device (4 available) [608ms]
    • FP4 (mobile)      • f6005300 • android-arm64  • Android 15 (API 35)
    • Windows (desktop) • windows  • windows-x64    • Microsoft Windows [version 10.0.26200.9448]
    • Chrome (web)      • chrome   • web-javascript • Google Chrome 154.0.8037.98
    • Edge (web)        • edge     • web-javascript • Microsoft Edge 150.0.4078.83 (unsupported)

[√] Network resources [411ms]
    • All expected network resources are available.

! Doctor found issues in 1 category.

Activity

  1. lingeshwaran-sf4984 commented on Oct 14, 2026

    @lingeshwaran-sf4984

    Hi @MobiliteDev ,
    We were able to reproduce the reported issue where value of a read-only text field is displayed twice on Android. We are currently validating this issue and will provide further updates on October 16, 2026.

    Regards,
    Lingeshwaran S

  2. lingeshwaran-sf4984 commented on Oct 16, 2026

    @lingeshwaran-sf4984

    Hi @MobiliteDev ,
    We have confirmed that the issue where value of a read-only text field is displayed twice on Android using Syncfusion Flutter PDF Viewer is a defect in our product and logged a bug report for the same. The fix for this issue will be included in the weekly release scheduled for October 27, 2026.
    Please use the feedback link to track the status of the bug, Link

    Disclaimer: "Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works reprioritization."

    Regards,
    Lingeshwaran S

  3. MobiliteDev commented on Oct 19, 2026

    @MobiliteDev
    Author

    Hi @lingeshwaran-sf4984,

    Thank you for the fast response and the planned fix for the October 27, 2026 weekly release.

    However, the feedback link you shared appears to be invalid. Could you please re-share a working link?

    Image
  4. lingeshwaran-sf4984 commented on Oct 20, 2026

    @lingeshwaran-sf4984

    Hi @MobiliteDev ,
    Could you please share your email ID so that we can provide you with access to the feedback link?

    Regards,
    Lingeshwaran S

  5. MobiliteDev commented on Oct 26, 2026

    @MobiliteDev
    Author

    Hi @lingeshwaran-sf4984,

    Apologies for the late reply, I missed the notification.
    It seems that the link is now valid.

  6. added
    bug
    pdf viewer
    follow-up scheduled
    on Oct 27, 2026
  7. lingeshwaran-sf4984 commented on Oct 27, 2026

    @lingeshwaran-sf4984

    Hi @MobiliteDev ,
    We have resolved an issue where Read-only text form field value is displayed twice on top of the native page rendering, and the fix has been included in the latest weekly release.
    Package link: syncfusion_flutter_pdfviewer v35.1.42

    Root cause: SfPdfViewerState._retrieveFormFieldsDetails() registered every AcroForm field in _pdfViewerController._formFields and FormFieldContainer rendered a Flutter widget on top of the page for each one. On Android, the page tile render layer paints the field value from the /AP /N appearance stream (or the page content stream for flattened signatures), so the value appears twice — slightly offset.

    We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you require any further assistance.

    Regards,
    Lingeshwaran S

  8. added
    waiting for customer response
    and removed
    follow-up scheduled
    on Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpdf viewerwaiting for customer response

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions