Closed
Description
Before you start - checklist
- I followed instructions in documentation written for my React-PDF versionI have checked if this bug is not already reportedI have checked if an issue is not listed in Known issuesIf I have a problem with PDF rendering, I checked if my PDF renders properly in PDF.js demo
Description
On v6.0.3, customTextRenderer no longer provide Page object in layer prop. Is there any reason for removing it? Currently we are using _pageIndex to do a cross div search, without it we couldn't tell which page the text is on.
Steps to reproduce
console log the layer prop of customTextRenderer function.
Expected behavior
get same object as in v5.7.2
Actual behavior
Page object no longer in it
Additional information
No response
Environment
- Browser (if applicable): Chrome 107
- React-PDF version: 6.0.3
- React version: 17.0.2
- Webpack version (if applicable):
Metadata
Metadata
Assignees
Labels
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
wojtekmaj commentedon Nov 23, 2022
This was never documented/intended.
paescuj commentedon Nov 23, 2022
Additionally, this has been announced as a breaking change in v6.0.0 (#944).
If you still need to access the current page you can easily control and track it via
pageIndex
.sherryzhang001 commentedon Nov 23, 2022
Could you explain more about it? How can I get pageIndex in customTextRenderer?
wojtekmaj commentedon Nov 23, 2022
Yeah, I actually don't see an easy way to do this unless you inline
customTextRenderer
and you have direct access to pageIndex you use to renderPage
components :D I'd be able to work around it, but no reason to force everyone else to suffer from it.paescuj commentedon Nov 23, 2022
Pretty simple:
But of course, it is more convenient if it is available out of the box 😄 So, thanks @wojtekmaj for 34fbf09!
sherryzhang001 commentedon Nov 24, 2022
Thank you so much for the update!! May I ask when will this change be released?
EricLiu0614 commentedon Nov 28, 2022
@wojtekmaj - Thank you for making the change! I also wondering when the new release will be published :)
Add pageIndex, pageNumber to customTextRenderer args