mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 08:13:56 +10:00
This commit is contained in:
@ -13,26 +13,30 @@ export default function PDFViewer() {
|
|||||||
setNumPages(nextNumPages);
|
setNumPages(nextNumPages);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const options = {
|
||||||
|
cMapUrl: "cmaps/",
|
||||||
|
cMapPacked: true,
|
||||||
|
standardFontDataUrl: "standard_fonts/",
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div>
|
<label htmlFor="file">Load from file:</label>{" "}
|
||||||
<div>
|
<input onChange={onFileChange} type="file" />
|
||||||
<label htmlFor="file">Load from file:</label>{" "}
|
<Document
|
||||||
<input onChange={onFileChange} type="file" />
|
file={"/sample.pdf"}
|
||||||
</div>
|
onLoadSuccess={onDocumentLoadSuccess}
|
||||||
<div>
|
options={options}
|
||||||
<Document file={file} onLoadSuccess={onDocumentLoadSuccess}>
|
>
|
||||||
{Array.from({ length: numPages }, (_, index) => (
|
{Array.from({ length: numPages }, (_, index) => (
|
||||||
<Page
|
<Page
|
||||||
key={`page_${index + 1}`}
|
key={`page_${index + 1}`}
|
||||||
pageNumber={index + 1}
|
pageNumber={index + 1}
|
||||||
renderAnnotationLayer={false}
|
renderAnnotationLayer={false}
|
||||||
renderTextLayer={false}
|
renderTextLayer={false}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</Document>
|
</Document>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user