@garage-panda/react-pdf-export
Advanced tools
Comparing version 0.0.2-alpha to 0.0.4-alpha
{ | ||
"name": "@garage-panda/react-pdf-export", | ||
"version": "0.0.2-alpha", | ||
"description": "PDF generator for React apps", | ||
"version": "0.0.4-alpha", | ||
"description": "A PDF generator for React applications", | ||
"main": "lib/index.js", | ||
@@ -6,0 +6,0 @@ "types": "lib/index.d.ts", |
@@ -1,2 +0,63 @@ | ||
# react-pdf-export | ||
react pdf export lol | ||
# Important | ||
The package is under development and this is the Alpha version of it. Stay still, we are doing our best to finish it soon. | ||
## react-pdf-export | ||
A PDF generator for React applications. | ||
## About | ||
It allows you to either download or print a pdf file with your own content. | ||
## Example | ||
## Installation | ||
Run | ||
`npm i @garage-panda/react-pdf-export` | ||
Import the package | ||
`import { PdfExport, useGeneratePdf } from '@garage-panda/react-pdf-export';` | ||
Retrieve the component and the useEffect | ||
`const { generatePdf, containerRef } = useGeneratePdf();` | ||
That's it! | ||
## Usage | ||
```JSX | ||
import { PdfExport, useGeneratePdf } from '@garage-panda/react-pdf-export'; | ||
const App() { | ||
const { generatePdf, containerRef } = useGeneratePdf(); | ||
return ( | ||
<React.Fragment> | ||
<button onClick={generatePdf}>Click me</button> | ||
<PdfExport containerRef={containerRef} options={{ | ||
styles: ['https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css'], | ||
scripts: ['https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js'] | ||
}}> | ||
<h1>This is the content of the PDF in here</h1> | ||
<p>Yes, you can put any child</p> | ||
<div>Because it's awesome!</div> | ||
</PdfExport> | ||
</React.Fragment> | ||
); | ||
} | ||
export default App; | ||
``` | ||
## Contributing | ||
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. | ||
## License | ||
[MIT](https://choosealicense.com/licenses/mit/) |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
63
3407
3
0
2