Skip to content

Form rendering issues with special characters in input text #3318

@cigas4

Description

@cigas4

In second half of the document special characters š and ž are displayed as a squares. If I click on the data field it comes back to normal, but when I click somewhere else again it is displayed wrong again.
Original document does not have this issue.
Somehow this issue appears only in a lower part of the document, in the upper ports same characters are displayed correctly.
Any ideas how to fix it?

Environment

I am using Adobe Acrobat 2025.001.20531

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

$ python -c "import pypdf;print(pypdf._debug_versions)"
pypdf==5.6.0, crypt_provider=('cryptography', '45.0.3'), PIL=11.2.1

Code + PDF

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

from pypdf import PdfReader, PdfWriter

reader = PdfReader("DPPA-EN.pdf")
writer = PdfWriter()
writer.append(reader)

fields_to_update = {
    "KOMENTARAI IR PASTABOS 1": "ąčęėįšųūž. ĄČĘĖĮŠŲŪŽ.",
    "NO": "1122",
    "VAL. SKAITLIUKAS": "12355",
    "IŠKVIETIMO PRIEŽASTIS 1": "ąčęėįšųūž. ĄČĘĖĮŠŲŪŽ.",
    "ATLIKTŲ DARBŲ SĄRAŠAS 1": "ąčęėįšųūž. ĄČĘĖĮŠŲŪŽ."
}

writer.update_page_form_field_values(
    writer.pages[0],
    fields_to_update,
    auto_regenerate=True,
)

with open("pypdf-out.pdf", "wb") as output_stream:
    writer.write(output_stream)

Original pdf file and output file:

pypdf-out.pdf

DPPA-EN.pdf

Original pdf file:
Image

Output pdf document after data field filled:
Image

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