Closed ShubhamSingh19 closed 5 months ago
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this issue will be closed in 14 days.
First of all, this code can't work - the correct way to mark every single text would be:
const customTextRenderer = useCallback(
(textItem: { str: string }) => `<mark>${textItem.str}</mark>`,
[],
);
Secondly, I couldn't reproduce that with my test PDFs. Therefore I'm going to close this for now until a reproducible example is provided. Thanks for understanding.
Before you start - checklist
Description
The customTextRenderer function is not called for the page if PDF file has links in that page (reference paragraph in same pdf). Else it is working normal, highlighting conditional text.
Steps to reproduce
<Page customTextRenderer={textRenderer}></Page>
const textRenderer = useCallback( (textItem) => <mark>{textItem}</mark>, [pageNumber] );
Expected behavior
All pages should be marked. Even with links.
Actual behavior
Pages that contain link do not highlight the text layer.
Additional information
"react-pdf": "^7.3.3",
Environment