PDF scale 3.5 taking longer to load in 4K responsive screen
See original GitHub issueI would like to zoom (scale 3.5) to a particular coordinate on the click of a button. It works fine on the laptop but it takes really long time in bigger screens like 4k responsive (2560 x 950). It’s taking up a lot of system memory too.
onButtonClick = () => {
this.setState({ scale: 3.5, pageNumber: 3, pdfLoader: true },
() => {
setTimeout(function () {
var canvasHolder = document.querySelector('.document-holder');
canvasHolder.style.overflow = 'auto';
canvasHolder.scroll({
top: 600,
left: 500,
behavior: 'smooth'
})
}, 800)
}
)
}
renderSuccess = (page) => {
if (page.pageIndex === this.state.pageNumber - 1) {
this.setState({
pdfLoader: false
})
}
}
render() {
var { pageNumber, scale, url } = this.state;
const override = css` display: block; margin: 0 auto; top:250px;z-index:100; height:0 !important`;
return (
<div>
<button onClick={this.onButtonClick}>test</button>
<FadeLoader css={override} height={15} width={5} radius={2} margin={2} color={"#4183C5"} loading={this.state.pdfLoader} />
<div id="doc-holder" className="document-holder" >
<Document file={url}>
<Page key={pageNumber} pageNumber={pageNumber} renderAnnotationLayer={false}
renderTextLayer={false}
noData='No file found'
className="canvas-pdf-page"
scale={scale}
width={window.innerWidth * 0.9}
onRenderSuccess={(page) => this.renderSuccess(page)}
/>
</Document>
</div>
</div>
)
}
Environment
- React-PDF version: 4.1.0
- React version: 16.12.0
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Responsive resize and constraints - Adobe Support
Learn how to use responsive resize and constraints for multiple screen sizes and layouts.
Read more >Adobe App Scaling on High DPI Displays (FIX) - Dan Antonielli
Long answer: When the apps load, Windows asks if the app is High DPI aware and these apps answer “yes”. Which is why...
Read more >Poly Video Mode (G7500, Studio X50, and Studio X30)
On the screen, long press the preset and choose Save. ▫ On the remote control, press a number to select a preset. Select...
Read more >Take a high resolution screenshot of a website - Super User
Magnify the webpage by zooming in (big enough till you want it), then make firefox into full screen mode. Press Print Screen button...
Read more >Photo Resolution: Sizes Needed for Printing Your Images
Here we discuss size, resolution, PPI, DPI, file formats and megapixels to ... of individual digital dots of color it takes to build...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
But it doesn’t take long in https://mozilla.github.io/pdf.js/web/viewer.html (pdf.js) when I view in 4K screen and change pages
This issue was closed because it has been stalled for 14 days with no activity.