OCR accessible PDF fails

Operating system

Linux

Joplin version

3.7.21

Desktop version info

Joplin 3.7.21 (prod, linux)

Gerät: linux, Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz
Client-ID: 6483eeccd480452dbd999748a55783a4
Sync-Version: 3
Profil-Version: 54
Unterstützter Schlüsselbund: Nein
Alternative Instanz ID: -
Sync target: Joplin Server
Editor: Markdown

Revision: e41516e

Backup: 1.5.1
Better Code Blocks: 2.0.2
Conflict Resolution: 1.2.3
Enhancement: 1.2.1
Freehand Drawing: 4.3.0
Geodata: 0.9.4.6
Katex Input Helper: 3.0.1
Math Mode: 1.0.0
Note Tabs: 1.4.0
Rich Tables: 1.8.18
Simple Image Resize: 1.7.1
Table Formatter Plugin: 1.2.1

What issue do you have?

When I right-click a PDF attachment and choose “Create accessible document”, an error appears after a few seconds:

Failed to create accessible document: WinAnsi cannot encode "ı" (0x0131)

(Screenshot attached)

It seems the OCR recognised a dotless “ı” (U+0131) somewhere in the document. That is probably a misrecognition, which is fine. The actual problem is that pdf-lib uses a standard font with WinAnsi encoding, so any character outside Windows-1252 makes the whole export fail.

Expected behaviour: The accessible PDF is created anyway, e.g. by embedding a Unicode font for the text layer or by replacing characters that cannot be encoded.

Regards, Helge

Screenshots