An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

React renderer for creating PDF files on the browser, mobile and server

[![npm](https://img.shields.io/npm/v/@react-pdf/renderer.svg)](https://www.npmjs.com/package/@react-pdf/renderer)
[![Travis](https://img.shields.io/travis/diegomura/react-pdf.svg)](https://travis-ci.org/diegomura/react-pdf)
[![license](https://img.shields.io/github/license/diegomura/react-pdf.svg)](https://github.com/diegomura/react-pdf/blob/master/LICENSE)
[![Join the community on Spectrum](https://withspectrum.github.io/badge/badge.svg)](https://spectrum.chat/react-pdf)
[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](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.







Text





Images





Resume





Fractals








Knobs





Page wrap


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)