1.1.11 • Published 9 months ago
@zoley/react-file-preview v1.1.11
File viewer for React
Niubility!
How to use
npm install @zoley/react-file-preview -S
Example
import {FileViewer,readBuffer} from "@zoley/react-file-preview";
// const {FileViewer,readBuffer}=await import("@zoley/react-file-preview") //1.1.9
const filePath = await readBuffer(file)
const fileType = 'pdf'
<FileViewer
fileType={fileType}
filePath={filePath}
/>
What file types are supported
case 'pdf':
case 'docx':
case 'xlsx':
case 'pptx':
case "gif":
case "jpg":
case "jpeg":
case "bmp":
case "tiff":
case "tif":
case "png":
case "txt":
case "json":
case "js":
case "css":
case "java":
case "py":
case "html":
case "jsx":
case "ts":
case "tsx":
case "xml":
case "md":
case "log":
case 'mp4':
The following note is only for previewing special fonts in PDF
Note: Copy cmaps from the dependency package lib folder to the public folder of the project
1.1.11
9 months ago
1.1.10
12 months ago
1.1.9
12 months ago
1.1.8
12 months ago
1.1.7
12 months ago
1.1.6
12 months ago
1.1.1
1 year ago
1.1.0
1 year ago
1.1.4
1 year ago
1.1.3
1 year ago
1.1.2
1 year ago
1.0.2
2 years ago
1.0.1
2 years ago
1.0.0
2 years ago
0.1.3
2 years ago
1.0.4
1 year ago
1.0.3
2 years ago
0.1.1
2 years ago
0.1.0
2 years ago