-
-
Notifications
You must be signed in to change notification settings - Fork 981
Closed
Labels
Description
This might be a good question for pdf.js community itself but how does rendering large PDFs can be better handled with react-pdf?
pdf.js suggests not rendering more than 25 pages at a time:
https://github.com/mozilla/pdf.js/wiki/Frequently-Asked-Questions#allthepages
I even had to add this to my component to keep react from trying re-create the virtual DOM of the Document:
shouldComponentUpdate(nextProps, nextState) {
if(nextProps.file !== this.props.file
|| nextState.numPages !== this.state.numPages
|| nextState.width !== this.state.width){
return true
}
return false
}
The problem is that I also need to dynamically set the width of the document on user interacting so I can't save myself from re-creating the virtual DOM after width changes, any way I can achieve this with your lib?
cindyloo