Closed mixeden closed 11 months ago
I have exactly the same problem. For this particular pdf defined customTextRenderer
is not called.
The method was executed correctly on the other pdf I worked on so far (using exactly the same code).
Browser (if applicable): Chrome ver. 116
React-PDF version: 7.3.3
React version: 18.2.0
Webpack version (if applicable): -
What is even more funny, it works on the majority pages of the PDF I attached in the reproduction section except a page number 4. I guess this is because this particular page had elements with class name "markedContent" in it somewhere to the top. Please check if your PDF from Volvo also has elements with the same class name in problematic places
Yup, I can confirm that marked content seems to have something to do with it. AFAICT, the moment this lib sees .markedContent,
it assumes that all text of that layer is inside the .markedContent
element. However, in our case, these are just empty blocks. https://github.com/wojtekmaj/react-pdf/blob/main/packages/react-pdf/src/Page/TextLayer.tsx#L207
Yes having this same issue with markedContent!
Before you start - checklist
Description
Well, customTextRenderer is not called!
My guess is because of this particular line: https://github.com/wojtekmaj/react-pdf/blob/v7.3.3/src/Page/TextLayer.tsx#L222
It seems that this layer has some marked content, but it is above the text I'm talking about (see "steps to reproduce"). It should not affect the text being rendered in any way.
Steps to reproduce
Expected behavior
customTextRenderer is called
Actual behavior
customTextRenderer is not called
Additional information
No response
Environment