1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 15:18:08 +02:00

Add lang attribute to canvas element

Fixes issue #16843.
In certain cases, the text layer was misaligned
due to a difference between the `lang` attribute
of the viewer and the canvas. This commit addresses
the problem by adding the `lang` attribute to the canvas.

The issue was caused because PDF.js uses serif/sans-serif
fonts to generate the text layer and relies on system fonts.
The difference in the `lang` attribute led to different fonts
being picked, causing the misalignment.
This commit is contained in:
Aditi 2024-05-17 14:35:21 +05:30
parent 9ee7c07b83
commit 9edca0a5ed
3 changed files with 21 additions and 7 deletions

View file

@ -0,0 +1 @@
https://github.com/mozilla/pdf.js/files/12366234/16_2020-044.pdf

View file

@ -2202,6 +2202,15 @@
"lastPage": 1,
"type": "eq"
},
{
"id": "issue16843-text",
"file": "pdfs/issue16843.pdf",
"md5": "2845b2f7f02690c388c24c488297028a",
"rounds": 1,
"link": true,
"lastPage": 1,
"type": "text"
},
{
"id": "issue5509",
"file": "pdfs/issue5509.pdf",