https://github.com/normalhuman01/credential-app
project - react pdf to create some credentials
https://github.com/normalhuman01/credential-app
Last synced: 12 months ago
JSON representation
project - react pdf to create some credentials
- Host: GitHub
- URL: https://github.com/normalhuman01/credential-app
- Owner: normalhuman01
- License: mit
- Created: 2023-12-12T22:44:36.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-12T22:45:57.000Z (over 2 years ago)
- Last Synced: 2025-03-27T07:48:15.487Z (about 1 year ago)
- Language: JavaScript
- Size: 5.9 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README

React renderer for creating PDF files on the browser, mobile and server
[](https://www.npmjs.com/package/@react-pdf/renderer)
[](https://travis-ci.org/diegomura/react-pdf)
[](https://github.com/diegomura/react-pdf/blob/master/LICENSE)
[](https://spectrum.chat/react-pdf)
[](https://github.com/prettier/prettier)
## How to install
```sh
yarn add @react-pdf/renderer
```
## How it works
```jsx
import React from 'react';
import { Document, Page, Text, View, StyleSheet } from '@react-pdf/renderer';
// Create styles
const styles = StyleSheet.create({
page: {
flexDirection: 'row',
backgroundColor: '#E4E4E4'
},
section: {
margin: 10,
padding: 10,
flexGrow: 1
}
});
// Create Document Component
const MyDocument = () => (
Section #1
Section #2
);
```
### Render in DOM
```jsx
import React from 'react';
import ReactDOM from 'react-dom';
ReactDOM.render(, document.getElementById('root'));
```
### Save in a file
```jsx
import React from 'react';
import ReactPDF from '@react-pdf/renderer';
ReactPDF.render(, `${__dirname}/example.pdf`);
```
### Render in mobile
> Coming soon
## Examples
For each example, try opening `output.pdf` to see the result.
To run the examples, first clone the project and install the dependencies:
```sh
git clone https://github.com/diegomura/react-pdf.git
cd react-pdf
yarn install
```
Then, run `yarn example -- `
```sh
yarn example -- fractals
```
## Contributors
This project exists thanks to all the people who contribute. [[Contribute]](CONTRIBUTING.md).

## Sponsors
Thank you to all our sponsors! [[Become a sponsors](https://opencollective.com/react-pdf#sponsors)]
## Backers
Thank you to all our backers! [[Become a backer](https://opencollective.com/react-pdf#backer)]
## License
MIT © [Diego Muracciole](http://github.com/diegomura)