Currently I'm trying to load a PDF using base64 data with this React component react-pdf-js.
I am currently recieving a PDFDocument: stream must have data
error when trying to load the PDF in the following manner:
<PDF
file={`data:application/pdf;base64,${this.state.base64}`}
onDocumentComplete={this.onDocumentComplete}
onPageComplete={this.onPageComplete}
page={this.state.page}
/>
I have had success loading a PDF onto the page using this React component react-pdf, but the library did not have the ability to implement pagination. The code that worked for that componenet was as follows:
<Document
file={`data:application/pdf;base64,${this.state.base64}`}
>
<Page pageNumber={this.state.pageNumber} />
</Document>
I was hoping someone would be able to help me figure out how to load a file using base64 using the react-pdf-js, or point me in a direction to implement pagination with react-pdf?