How can I add a scrollbar?
See original GitHub issueI would like to fix the showing area width, and in the meantime, can scroll the pdf page if it is beyond the area width.
The way I use it now is <Document> <Page width={a fixed number} scale={a changeable number}/> </Document>
. But I don’t think this is the right way. plus if fix the width in Page, I cannot zoom in/out by changing the scale.
Can you please advise?
thank you.
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (2 by maintainers)
Top Results From Across the Web
How do you add a scroll bar to a div? - Stack Overflow
You need to add style="overflow-y:scroll;" to the div tag. (This will force a scrollbar on the vertical). If you only want a scrollbar...
Read more >How To Create a Custom Scrollbar - W3Schools
Learn how to create a custom scrollbar with CSS. Custom Scrollbars. Custom Scrollbar Example. Note: The -webkit-scrollbar is not supported in Firefox or...
Read more >Learn How to Create a Scrollbar in Html Table? - eduCBA
Suppose we want to add a scroll bar option in HTML, use an “overflow” option and set it as auto-enabled for adding both...
Read more >How to add scrollbar to div - Educative.io
To add scrollbar on both axes, you can add the overflow property instead of adding both overflow-x and overflow-y properties. RELATED TAGS. html....
Read more >How To Create A Vertical Scrollbar In HTML - Part 1/2 - YouTube
You can add the default scrollbar very easily. If you want to modify your scrollbar, just add some additional CSS code as shown...
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
@chinalwb You can wrap the Document/Page element in a div with a specified height and style={{overflow: “scroll”}}. If the pdf element overflows this div then a scrollbar will be added. I’m currently using this approach to enable scrolling in my project with scrollbars set to hidden. Rendering multiple pages for large pdfs and getting it to interact well with scrolling is non-trivial. See https://github.com/wojtekmaj/react-pdf/issues/94
Just an update for my issue. I need to add
transform: translate(0px, 50px)
andoverflow: scroll
to the<div>
under the toolbar. Thanks again @wojtekmaj for the advice and the wonderful pdf render component!