Skip to content

Read-only form fields appear duplicated in latest syncfusion_flutter_pdfviewer after saving with PdfFlattenOption.formFields #2530

Closed

Description

@phyueimon162

Bug description

A platform-specific error occurred on Android.

In the latest version of syncfusion_flutter_pdfviewer, when:

Setting form fields to read-only
Binding a value to the field
Saving the PDF using PdfFlattenOption.formFields

the saved file is correct.

However, when reopening the saved PDF inside syncfusion_flutter_pdfviewer (latest version only), the read-only form fields appear duplicated.

When the same file is opened in external PDF tools (e.g., Adobe Acrobat), it displays correctly without duplication.

Version 29.2.10 works correctly.

Steps to reproduce

  1. Open a fillable PDF in syncfusion_flutter_pdfviewer.
  2. Set some text and make readOnly form fields using the below method:
  3. Save the PDF using PdfFlattenOption.formFields.
  4. Reopen the saved file in syncfusion_flutter_pdfviewer.

Code sample

Code Used to Set Read-Only Fields
void setFormFieldValue(String fieldName, String value) {
  try {
    PdfFormField? formField =
        formFields.where((element) => element.name == fieldName).firstOrNull;

    if (formField != null) {
      formField as PdfTextFormField;
      formField.text = value;
      formField.readOnly = true;
    }
  } catch (e) {
    return;
  }
}

Screenshots or Video

Screenshots / Video demonstration Image

Stack Traces

Stack Traces
[Add the Stack Traces here]

On which target platforms have you observed this bug?

Android

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.41.4, on macOS 26.3 25D125 darwin-arm64, locale en-MM)
[✓] Android toolchain - develop for Android devices (Android SDK version 36.1.0)
[✓] Xcode - develop for iOS and macOS (Xcode 26.4.1)
[✓] Chrome - develop for the web
[✓] Connected device (1 available)
[✓] Network resources

Activity

  1. added
    pdf viewer
    open
    on May 14, 2026
  2. AbinayaSF4962 commented on May 14, 2026

    @AbinayaSF4962

    Hi @phyueimon162 ,
    We suspect that the issue may be related to the specific document being used. However, we were unable to reproduce the reported issue where read-only form fields appear duplicated when reopening the saved PDF in the latest version of the Syncfusion Flutter PDF Viewer.
    Please find the attached sample we used to replicate the issue, along with a video recording.
    Could you please check the attached sample and let us know whether the issue still occurs on your end? If so, could you kindly share the document where the issue occurred?

    sfpdfviewer_2530.zip

    sfpdfviewer_2530.mp4

    Regards,
    Abinaya E

  3. added
    waiting for customer response
    and removed
    open
    on May 18, 2026
  4. phyueimon162 commented on May 20, 2026

    @phyueimon162
    Author

    Hi Syncfusion Team,

    Thank you very much for your response and support.

    I would like to kindly clarify one point regarding our implementation. In our case, we are using PdfFlattenOption.none instead of the standard flatten option. I apologize for any confusion caused in my earlier question.

    This approach is necessary for our draft-saving feature, as we need some form fields to remain editable for future updates, so full flattening is not suitable for our use case.

    I have also tested your sample project, and I noticed that the read-only form fields appear to be duplicated when reopening the saved PDF using the latest version of syncfusion_flutter_pdfviewer.

    Could I kindly ask you to retest the scenario after removing the document.form.flattenAllFields(); line? This is important for our case since we are not applying full flattening.

    Thank you again for your time and assistance. I really appreciate your support and look forward to your guidance.

    Image
  5. AbinayaSF4962 commented on May 21, 2026

    @AbinayaSF4962

    Hi @phyueimon162 ,

    We are able to reproduce the reported issue where read-only form fields appear duplicated when reopening the saved PDF in the latest version of the Syncfusion Flutter PDF Viewer. We are currently validating this issue and will provide further updates on May 25, 2026.

    Regards,
    Abinaya E

  6. AbinayaSF4962 commented on May 25, 2026

    @AbinayaSF4962

    Hi @phyueimon162 ,

    We suspect that the issue with read-only form fields appear duplicated when reopening the saved PDF is related to the dependent Syncfusion Flutter PDF library. We are currently validating this issue and will provide further updates on May 27, 2026.

    Regards,
    Abinaya E

  7. AbinayaSF4962 commented on May 27, 2026

    @AbinayaSF4962

    Hi @phyueimon162 ,

    We apologize for the inconvenience. We are still validating this issue due to the complexity involved in the issue "duplication of read-only form fields when reopening the saved PDF". We will provide further updates on June 01, 2026.

    Regards,
    Abinaya E

  8. AbinayaSF4962 commented on Jun 1, 2026

    @AbinayaSF4962

    Hi @phyueimon162 ,

    We have confirmed that the issue where read-only form fields appear duplicated when reopening the saved PDF in the latest version of the 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 June 16, 2026.

    Please use the feedback link to track the status of the bug, Read-only form fields duplicated when reopening PDF without flattening (PdfFlattenOption.none) in F…
    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,
    Abinaya E

  9. added
    follow-up scheduled
    bug
    and removed
    waiting for customer response
    on Jun 2, 2026
  10. AbinayaSF4962 commented on Jun 16, 2026

    @AbinayaSF4962

    Hi @phyueimon162 ,

    We are experiencing some testing failure in this fix. We will fix the testing failures and will include the complete fix in the Volume 2 main release, which is scheduled for the fourth week of June, without further delay.

    Regards,
    Abinaya E

  11. AbinayaSF4962 commented on Jun 19, 2026

    @AbinayaSF4962

    Hi @phyueimon162 ,

    We have resolved the issue where read-only form fields appear duplicated when reopening the saved PDF in the latest version of the Syncfusion Flutter PDF Viewer, and the fix has been included in the latest weekly release.

    Package link: syncfusion_flutter_pdfviewer v33.2.13+1

    Root cause: Duplication occurs because read-only fields with multiple widget annotations render both native PDF content and a single Flutter overlay, causing overlap. To resolve this, avoid creating overlay widgets for read-only or flattened fields, and generate overlays only for editable fields using exact positions while clearing existing helpers to prevent duplication.

    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,
    Abinaya E

  12. added
    waiting for customer response
    solved
    and removed
    follow-up scheduled
    bug
    on Jun 19, 2026
  13. removed
    waiting for customer response
    on Jul 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

    pdf viewersolved

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions