Skip to content

Responsive PDF in PDFViewer #1722

Closed Answered by nicholsss
nicholsss asked this question in Q&A
Discussion options

You must be logged in to vote

I got this resolved by using const { height, width } = useViewportSize();Basically getting viewport size and then giving height and width for the Page:

          <Page
            key={currentPage}
            pageNumber={currentPage}
            width={width < 768 ? 0.7 * width : 0.4 * width}
            height={width < 768 ? 0.7 * height : 0.4 * height}
          />

``

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by nicholsss
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant