-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
1,179 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
// "use client"; | ||
|
||
// import { useState, useCallback, useEffect } from "react"; | ||
|
||
// import { pdfjs, Document, Page } from "react-pdf"; | ||
// import "react-pdf/dist/esm/Page/AnnotationLayer.css"; | ||
// import "react-pdf/dist/esm/Page/TextLayer.css"; | ||
|
||
// import "./pdf.css"; | ||
|
||
// pdfjs.GlobalWorkerOptions.workerSrc = `//unpkg.com/pdfjs-dist@${pdfjs.version}/legacy/build/pdf.worker.min.mjs`; | ||
// // pdfjs.GlobalWorkerOptions.workerSrc = `//unpkg.com/pdfjs-dist@${pdfjs.version}/build/pdf.worker.min.mjs`; | ||
// // pdfjs.GlobalWorkerOptions.workerSrc = `https://cdnjs.cloudflare.com/ajax/libs/pdf.js/${pdfjs.version}/pdf.worker.min.mjs`; | ||
|
||
|
||
// type PDFFile = string | File | null; | ||
|
||
// export default function PDF() { | ||
// const [file, setFile] = useState<PDFFile>("./sample.pdf"); | ||
// const [numPages, setNumPages] = useState<number>(); | ||
// const [isClient, setIsClient] = useState(false); | ||
|
||
// const onDocumentLoadSuccess = useCallback( | ||
// ({ numPages }: { numPages: number }) => { | ||
// setNumPages(numPages); | ||
// }, | ||
// [] | ||
// ); | ||
|
||
// useEffect(() => { | ||
// setIsClient(true); | ||
// }, []); | ||
|
||
// if (!isClient) { | ||
// return null; | ||
// } | ||
|
||
// return ( | ||
// <div className="Example"> | ||
// <div className="Example__container"> | ||
// <div className="Example__container__document"> | ||
// <Document | ||
// file={file} | ||
// loading={"Please wait i am loading"} | ||
// onLoadSuccess={onDocumentLoadSuccess} | ||
// onLoadError={(error) => console.log(error)} | ||
// > | ||
// {Array.from(new Array(numPages), (_el, index) => ( | ||
// <Page | ||
// key={`page_${index + 1}`} | ||
// pageNumber={index + 1} | ||
// renderTextLayer={false} | ||
// // renderInteractiveForms={false} | ||
// /> | ||
// ))} | ||
// </Document> | ||
// </div> | ||
// </div> | ||
// </div> | ||
// ); | ||
// } | ||
|
||
import React from "react"; | ||
|
||
export default function Pdf() { | ||
|
||
return( | ||
<div>pdf</div> | ||
) | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
body { | ||
margin: 0; | ||
padding: 0; | ||
background-color: #190d2c; | ||
} | ||
|
||
.Example__container { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
.Example__container__load { | ||
margin-top: 1em; | ||
color: white; | ||
} | ||
|
||
.Example__container__document { | ||
width: 55vw; | ||
max-width: calc(100% - 2em); | ||
margin: 0em 0; | ||
height: 80vh; | ||
overflow-y: scroll; | ||
} | ||
|
||
.Example__container .react-pdf__Page__canvas { | ||
width: 100%; | ||
height: 100%; | ||
} | ||
|
||
.Example__container__document .react-pdf__Document { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
} | ||
|
||
.Example__container__document .react-pdf__Page { | ||
margin: 0.2em 0; | ||
box-shadow: 0 0 8px rgba(0, 0, 0, 0.5); | ||
} | ||
|
||
.Example__container__document .react-pdf__message { | ||
padding: 20px; | ||
color: white; | ||
} | ||
|
||
.view { | ||
height: 70vh; | ||
width: 80vw; | ||
overflow: hidden; | ||
background-color: white !important; | ||
margin: 0; | ||
padding: 0; | ||
border: none; | ||
} | ||
|
||
@media (max-width: 500px) { | ||
.view { | ||
height: 70vw; | ||
width: 50vw; | ||
} | ||
} |
Oops, something went wrong.