
Product
Introducing Module Reachability: Focus on the Vulnerabilities That Matter
Module Reachability filters out unreachable CVEs so you can focus on vulnerabilities that actually matter to your application.
react-office-previewer
Advanced tools
A React component to preview document of 'pdf,xls,xlsx,docx', which can automatically identify file types.
npm install react-office-viewer
import Viewer from "react-office-viewer"
//If you only want to preview a certain format, you can import them individually.
import { SheetViewer, PdfViewer, DocxViewer } from "react-office-viewer"
// Pass a url that can get the file stream.
<Viewer file="http://xxxx"/>
// Or, pass a File Object.
<Viewer file={ fileObject }/>
<input type='file' onChange={this.getFileObject} />
getFileObject = e => {
this.setState({ fileObject: e.target.files[0] });
}
//other optional params:
let params = {
fileName, //PropTypes.string
locale: 'en', // PropTypes.oneOf(['zh','en'])
width, //PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
height, //PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
timeout: 10000, //PropTypes.number. Timeout limit of url request, only works on sheet/docx previewer.
}
<Viewer file="http://xxxx" {...params} />
效果样例:
handsontable,
mammoth,
xlsx,
pdfjs-dist
FAQs
A React component to preview document of 'pdf,xls,xlsx,docx', which can automatically identify file types.
The npm package react-office-previewer receives a total of 15 weekly downloads. As such, react-office-previewer popularity was classified as not popular.
We found that react-office-previewer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Module Reachability filters out unreachable CVEs so you can focus on vulnerabilities that actually matter to your application.
Company News
Socket is bringing best-in-class reachability analysis into the platform — cutting false positives, accelerating triage, and cementing our place as the leader in software supply chain security.
Product
Socket is introducing a new way to organize repositories and apply repository-specific security policies.