Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose Contexts using hooks #1505

Closed
wants to merge 1 commit into from

Conversation

iamandrewluca
Copy link
Contributor

Reason: Want to create a Thumbnail component, and need access to the DocumentContext

@wojtekmaj
Copy link
Owner

I think it's generally a good idea, will review more carefully soon.

In the meantime, just curious: how will thumbnail be different from just Page with additional layers disabled? 🤔

@iamandrewluca
Copy link
Contributor Author

iamandrewluca commented May 29, 2023

I looked through pdf.js/viewer and saw that they generate low-resolution images from the page.
I think this may improve performance a little, because when using Page I suppose any change in Document that Page depends upon, will make the page re-execute some logic.
With images there should be no such problem, they are generated once.

If I will find an elegant way to create a Thumbnail component, I will propose to be included in react-pdf

@wojtekmaj
Copy link
Owner

Oh, now I see it. I think the main problem would be that the Page component "registers" itself in Document component to basically say "hey I'm here" so that whenever you click an internal link in PDF it could scroll to this particular page. Thumbnail should be stripped off from this logic.

@wojtekmaj
Copy link
Owner

Hey, there were merge conflicts so I went ahead and committed the changes based on your work and added you as a co-author. Hope that's alright :)

@wojtekmaj wojtekmaj closed this in 72f4da8 Jun 5, 2023
@iamandrewluca iamandrewluca deleted the export-contexts branch June 6, 2023 06:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants