Gathering detailed insights and metrics for pdf-react
Gathering detailed insights and metrics for pdf-react
Gathering detailed insights and metrics for pdf-react
Gathering detailed insights and metrics for pdf-react
npm install pdf-react
Typescript
Module System
Node Version
NPM Version
JavaScript (88.8%)
CSS (10.56%)
HTML (0.64%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
6 Stars
45 Commits
2 Forks
2 Watchers
17 Branches
1 Contributors
Updated on Jun 16, 2022
Latest Version
1.5.1
Package Id
pdf-react@1.5.1
Unpacked Size
45.19 kB
Size
11.26 kB
File Count
9
NPM Version
6.14.15
Node Version
14.18.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
A simple pdf viewer for react
1npm i pdf-react 2npm i worker-loader -D
1import PdfViewer from "pdf-react"; 2 3<PdfViewer src="http://exmple/test.pdf" />;
1import PdfViewer from "pdf-react"; 2 3import pdf from "./static/1.pdf"; 4 5<PdfViewer src={pdf} />;
1/** 2 * props 3 * @param {string} src 4 * @param {boolean} isSerial 5 * @param {number} page 6 * @param {number} rotate 0 90 180 270 7 * @param {boolean} hideArrow 8 * @param {boolean} hidePageNum 9 * @param {boolean} showProgress when load large file, you can turn on and you will see the load progress 10 * @param {func} onLoaded 11 * @param {func} onPageUpdate 12 * @param {func} onGetTotalPage 13 * @param {func} onError 14 * @param {func} onProgress 15 * @param {func} onPageSize 16 * @param {func} onLinkClick 17 */
1 constructor(props) { 2 super(props); 3 this.pdfViewer = React.createRef(); 4 } 5 6 /** 7 * @param {string} dpi optional default: 150 8 * @param {arr} pageList optional example: [1, 2, 3] 9 */ 10 onPrint(dpi, pageList){ 11 this.pdfViewer.current.print(200, [1]); 12 } 13 14 render() { 15 const { page } = this.state; 16 return ( 17 <div> 18 <button onClick={this.onPrint.bind(this)}>Print</button> 19 <PdfViewer src={pdfResource} ref={this.pdfViewer} /> 20 </div> 21 ); 22 } 23
At the begin i use react-pdf to render pdf files, but it has so much trouble, not only It's very troublesome to use, but also it make us bundle size larger 1~2M than before,here is the webpack-bundle-analyzer result
and this is our library webpack-bundle-analyzer result, only 200kb
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
Found 0/18 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
license file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
91 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More