Installations
npm install @react-pdf/textkit
Releases
@react-pdf/textkit@5.0.1
Published on 26 Nov 2024
@react-pdf/renderer@4.1.5
Published on 26 Nov 2024
@react-pdf/render@4.0.2
Published on 26 Nov 2024
@react-pdf/reconciler@1.1.3
Published on 26 Nov 2024
@react-pdf/layout@4.1.3
Published on 26 Nov 2024
@react-pdf/renderer@4.1.4
Published on 18 Nov 2024
Developer
Developer Guide
Module System
ESM
Min. Node Version
Typescript Support
No
Node Version
20.18.0
NPM Version
10.8.2
Statistics
15,019 Stars
1,042 Commits
1,188 Forks
100 Watching
9 Branches
143 Contributors
Updated on 28 Nov 2024
Languages
JavaScript (99.87%)
Shell (0.09%)
HTML (0.03%)
CSS (0.01%)
Total Downloads
Cumulative downloads
Total Downloads
58,543,366
Last day
-5.9%
111,144
Compared to previous day
Last week
1.4%
623,190
Compared to previous week
Last month
12.6%
2,607,457
Compared to previous month
Last year
59.5%
25,404,317
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
React renderer for creating PDF files on the browser and server
Lost?
This package is used to create PDFs using React. If you wish to display existing PDFs, you may be looking for react-pdf.
How to install
1yarn add @react-pdf/renderer
How it works
1import React from 'react'; 2import { Document, Page, Text, View, StyleSheet } from '@react-pdf/renderer'; 3 4// Create styles 5const styles = StyleSheet.create({ 6 page: { 7 flexDirection: 'row', 8 backgroundColor: '#E4E4E4', 9 }, 10 section: { 11 margin: 10, 12 padding: 10, 13 flexGrow: 1, 14 }, 15}); 16 17// Create Document Component 18const MyDocument = () => ( 19 <Document> 20 <Page size="A4" style={styles.page}> 21 <View style={styles.section}> 22 <Text>Section #1</Text> 23 </View> 24 <View style={styles.section}> 25 <Text>Section #2</Text> 26 </View> 27 </Page> 28 </Document> 29);
Web.
Render in DOM
1import React from 'react'; 2import ReactDOM from 'react-dom'; 3import { PDFViewer } from '@react-pdf/renderer'; 4 5const App = () => ( 6 <PDFViewer> 7 <MyDocument /> 8 </PDFViewer> 9); 10 11ReactDOM.render(<App />, document.getElementById('root'));
Node.
Save in a file
1import React from 'react'; 2import ReactPDF from '@react-pdf/renderer'; 3 4ReactPDF.render(<MyDocument />, `${__dirname}/example.pdf`);
Contributors
This project exists thanks to all the people who contribute. Looking to contribute? Please check our [contribute] document for more details about how to setup a development environment and submitting code.
Sponsors
Thank you to all our sponsors! [Become a sponsors]
Backers
Thank you to all our backers! [Become a backer]
License
MIT © Diego Muracciole
No vulnerabilities found.
Reason
30 commit(s) and 8 issue activity found in the last 90 days -- score normalized to 10
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
Found 4/26 approved changesets -- score normalized to 1
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
14 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-8hc4-vh64-cxmj
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-ghr5-ch3p-vcr6
- Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj
- Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp
- Warn: Project is vulnerable to: GHSA-wgrm-67xf-hhpq
- Warn: Project is vulnerable to: GHSA-wpg7-2c88-r8xv
- Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36
- Warn: Project is vulnerable to: GHSA-7p7h-4mm5-852v
- Warn: Project is vulnerable to: GHSA-8jhw-289h-jh2g
- Warn: Project is vulnerable to: GHSA-64vr-g452-qvp3
- Warn: Project is vulnerable to: GHSA-9cwx-2883-4wfx
- Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q
Score
4.1
/10
Last Scanned on 2024-11-25
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