Skip to content

Arabic text not rendered correctly in filled PDF forms after version 3.9.1 #3514

@almousa2000

Description

@almousa2000

While testing PDF form filling with the latest version of pypdf, I noticed that Arabic text is not displayed correctly in the generated PDF.
However, when I downgrade to version 3.9.1, Arabic text renders properly.
The issue seems to have been introduced after that version.

Unfortunately, version 3.9.1 does not support filling dropdown fields, so I can’t use it as a workaround for all cases.

Environment

python 3.13.1

$ python -m platform
Windows-11-10.0.26100-SP0

$ python -c "import pypdf;print(pypdf._debug_versions)"
pypdf==6.1.3, crypt_provider=('cryptography', '46.0.3'), PIL=12.0.0

Code + PDF

This is a minimal, complete example that shows the issue:

from pypdf import PdfReader, PdfWriter

reader = PdfReader("input.pdf")
writer = PdfWriter()

writer.append(reader)

writer.update_page_form_field_values(
    writer.pages[0], {
        "Defendant full name":"احمد الموسى",
        "Defendant_email": "test@gmail.com",
        "Place": "Al Ain العين"
    }
)

with open("output.pdf", "wb") as output_stream:
    writer.write(output_stream)

input pdf:

input.pdf

output images:

Image Image

Traceback

This is the complete traceback I see:

no error just not support

Metadata

Metadata

Assignees

No one assigned

    Labels

    workflow-formsFrom a users perspective, forms is the affected feature/workflow

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions