You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This discussion was converted from issue #19104 on November 26, 2024 08:30.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Attach (recommended) or Link to PDF file
I found this PR for text layer text offset, recalculating ascent and descent.
#12896
But the ratio calculated by the property
ascent/(ascent + descent)
in getTextContent does not match.Which is the right way?
Web browser and its version
chrome 130.0.6723.70
Operating system and its version
macOS 14.1 (23B2073)
PDF.js version
latest
Is the bug present in the latest PDF.js version?
Yes
Is a browser extension
No
Steps to reproduce the problem
P1
https://www.mckinsey.com/~/media/mckinsey/business%20functions/mckinsey%20digital/our%20insights/the%20economic%20potential%20of%20generative%20ai%20the%20next%20productivity%20frontier/the-economic-potential-of-generative-ai-the-next-productivity-frontier.pdf
What is the expected behavior?
The logic is consistent in both places
What went wrong?
Calculations using the ascent attribute in getTextContent will be slightly offset

Using the calculations in the text layer is more accurate

Link to a viewer
No response
Additional context
No response
Beta Was this translation helpful? Give feedback.
All reactions