0

I am not sure what i am doing wrong since i followed the guide for react-pdf to the point.I believe I am not importing the pdf in the right way because I dont see anythign in my app. here is the code

      import { Document, Page } from 'react-pdf';
      import example from '../../assets/example.pdf';



 onDocumentLoad = ({ numPages }) => {
this.setState({ numPages });
}
render() {
const { classes } = this.props;
const { pageNumber, numPages ,example } = this.state;

return (

  <Document
      file={example}
      onLoadSuccess={this.onDocumentLoad}
    >
      <Page pageNumber={pageNumber} />
    </Document>
    <p>Page {pageNumber} of {numPages}</p>
sod.heretic
  • 126
  • 1
  • 13
  • Could you share your version of react-pdf and react?And are there any error messages? – Root Nov 01 '18 at 13:27
  • "react": "^16.6.0", "react-datetime": "2.15.0", "react-dom": "^16.6.0", "react-pdf": "^3.0.5", no errors just blank space and A line saying ,maybe I need to import the pdf in a diferent way? – sod.heretic Nov 01 '18 at 13:32

0 Answers0