Replies: 2 comments
-
Try something similar to this, cus this worked for me: import type { PDFDocumentProxy } from 'pdfjs-dist';
export default function Viewer() {
const [pdfSource, setPdfSource] = useState<PDFDocumentProxy>();
function onDocumentLoadSuccess( pdf: PDFDocumentProxy ): void {
...
setPdfSource(pdf);
}
function onItemClick({ pageNumber: itemPageNumber }: { pageNumber: number }): void {
setPageNumber(itemPageNumber);
}
return(
<div>
<div>
<Outline pdf={pdfSource} onItemClick={onItemClick} className={"border-2"}/>
</div>
<div>
<Document file={samplePath} onLoadSuccess={onDocumentLoadSuccess}></Document>
</div>
</div>
)
} |
Beta Was this translation helpful? Give feedback.
0 replies
-
The simplest way would be... Not to do it, just put |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm using Outline outside of Document. I'm not quite sure how to implement the suggest solution.
Any help would really be appreciated!
Beta Was this translation helpful? Give feedback.
All reactions