Bug 471796

Summary: pdf with forms does not handle special characters
Product: [Applications] okular Reporter: al F <public>
Component: PDF backendAssignee: Okular developers <okular-devel>
Status: CONFIRMED ---    
Severity: normal CC: aacid, andreaswuest, axel.braun, dmatej, jasmin+kde, kde, kn5i02tst, matthias.j.w.heil, mira.jary, oleksandr, piecka, steffen-winkler
Priority: NOR    
Version First Reported In: 23.04.1   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Document with form fields that don't accept special characters

Description al F 2023-06-30 15:36:57 UTC
SUMMARY
When clicking "show forms" and filling in, everything looks fine. However, clicking "Show forms" again after filling in text, `æ` and `å` just disappears while `ø` is changed to `ł`. If filling in `ł` it disappears.

Font sizes are also distorted, it seems Okular adjusts the size to fill each form entirely, rendering the document layout ugly. Printing uses the wrong display, even if forms are currently showing the correct characters.

STEPS TO REPRODUCE
1. Download https://www.politiet.no/globalassets/02-tjenester-admin/politiattest/bekreftelse-pa-formal-med-soknad-om-politiattest.pdf
2. Open with Okular and click "Show forms". Fill in text containing special characters (the Norwegian æ, ø, å or others like ł or µ)
3. Click "Show forms" again.

OBSERVED RESULT
Text is incorrectly displayed and printed

EXPECTED RESULT
Text should be correctly displayed and printed

SOFTWARE/OS VERSIONS
Operating System: Manjaro Linux 
KDE Plasma Version: 5.27.5
KDE Frameworks Version: 5.106.0
Qt Version: 5.15.9
Kernel Version: 5.15.114-2-MANJARO (64-bit)
Graphics Platform: X11

ADDITIONAL INFORMATION
Filling in forms / saving / opening / displaying in Firefox works as expected. Printing to pdf from Firefox and opening in Okular, characters display correctly but font sizes are inconsistent.
Comment 1 Matthias 2025-01-20 16:15:36 UTC
I still see this problem in Okular 24.05.2 when trying to fill out forms using German umlauts (ä, ü, ö).
Comment 2 John Kizer 2025-06-19 06:28:39 UTC
*** Bug 475025 has been marked as a duplicate of this bug. ***
Comment 3 John Kizer 2025-06-19 06:29:04 UTC
*** Bug 475884 has been marked as a duplicate of this bug. ***
Comment 4 John Kizer 2025-06-19 06:29:35 UTC
*** Bug 505413 has been marked as a duplicate of this bug. ***
Comment 5 Steffen W. 2025-09-03 14:48:48 UTC
This is the same issue I reported a couple months after you -> https://bugs.kde.org/show_bug.cgi?id=476436 except in the file you linked, which I was able to retrieve via the waybackmachine as that link results in a 404, every text field is affected by this bug. I'm uploading the file I got from the waybackmachine as an attachment.
Comment 6 Steffen W. 2025-09-03 14:50:21 UTC
Created attachment 184674 [details]
Document with form fields that don't accept special characters
Comment 7 Steffen W. 2025-09-03 14:50:48 UTC
*** Bug 476436 has been marked as a duplicate of this bug. ***
Comment 8 Sune Vuorela 2025-09-12 12:33:54 UTC
The 'common case' has now been fixed in Poppler. The uncommon case has gotten better, but still isn't really good.

What I describe as 'common case' is having diacritics and such from a single or a few related languages. What I describe as uncommon is having characters from very unrelated languages. 

Mixing e.g. japanese characters and french accents in same form field is an example of what I have put in the 'uncommon' description.
Comment 9 Steffen W. 2025-09-12 13:49:40 UTC
Hi,

assuming you solved it in this commit? https://gitlab.freedesktop.org/poppler/poppler/-/commit/ab1d04981127e0a146fb4f238af54d83a607f76a

I installed poppler-git from the AUR and it improved the situation a little bit but didn't fix the issue.

Referring to my comment in my duplicate of a bugreport -> https://bugs.kde.org/show_bug.cgi?id=476436#c10 with poppler-git the characters in the "Anschrift" field are rendered correctly. However, in the "Kennzeichen" and "Datum, Unterschrift" the issue is persisting and no special character is rendered except for ø which is rendered as `ł`.

In the file that is attached to this bug report I am unable to observe any change in behaviour to before.
Comment 10 Steffen W. 2025-09-12 13:52:42 UTC
(In reply to Steffen W. from comment #9)
> Hi,
> 
> assuming you solved it in this commit?
> https://gitlab.freedesktop.org/poppler/poppler/-/commit/
> ab1d04981127e0a146fb4f238af54d83a607f76a
> 
> I installed poppler-git from the AUR and it improved the situation a little
> bit but didn't fix the issue.
> 
> Referring to my comment in my duplicate of a bugreport ->
> https://bugs.kde.org/show_bug.cgi?id=476436#c10 with poppler-git the
> characters in the "Anschrift" field are rendered correctly. However, in the
> "Kennzeichen" and "Datum, Unterschrift" the issue is persisting and no
> special character is rendered except for ø which is rendered as `ł`.
> 
> In the file that is attached to this bug report I am unable to observe any
> change in behaviour to before.

Ignore this. I used a wrong package that didn't pull the latest changes. Sorry.