MGrin / mgr-pdf-viewer-react

React PDF Viewer component
MIT License
72 stars 24 forks source link

To specific page number #32

Closed Karthikdb closed 4 years ago

Karthikdb commented 4 years ago

How to navigate to a specific page number???

 <PDFViewer
            document={{
                url: this.props.data,
                page:2
            }}
            css="pdf_height"
            navigation={{
              css: {
                previousPageBtn: (this.props.host?'pdf_navigation_host':'pdf_navigation_guest'),  
                nextPageBtn: (this.props.host?'pdf_navigation_host':'pdf_navigation_guest'), 
            }

            }}
        />
MGrin commented 4 years ago

Hi @KathikBaskaran ! If you look in the documentation, the page prop allows you to set the initial PDF page. Note that it's a component prop, not the field in the document prop.