Change the loaded pdf layout (height and width) in react-pdf.
This includes :
First if you want to load a pdf in reactjs, you can refer this article https://levelup.gitconnected.com/displaying-pdf-in-react-app-6e9d1fffa1a9
And you can also clone https://github.com/wojtekmaj/react-pdf
After that, add some css to position it to center and define your own height and width of the document
.react-pdf__Page__canvas {
margin: 0 auto;
width: 80% !important;
height: 100% !important;
}
And you are good to go.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With