Approach to Zoom in/out PDF using React
This React code utilizes the ‘react-pdf’ library to render a PDF file (‘sample.pdf’). The App component includes a Document component with a specified PDF file, and within it, a Page component renders the first page with a scale of 2.0.
How to Zoom in/Zoom out using React-PDF in React JS ?
Zooming in or out in React-PDF within a React JS application is achieved by using the ‘scale’ prop inside the `<Page />` component. The ‘scale’ prop accepts decimal values; values greater than 1 zoom in, while values less than 1 zoom out the page.