how to create a pdf in react
/*
Make sure to install the library
with yarn
yarn add @react-pdf/renderer
with npm
npm install @react-pdf/renderer --save
*/
import React from 'react';
import { Page, Text, View, Document, 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 = () => (
<Document>
<Page size="A4" style={styles.page}>
<View style={styles.section}>
<Text>Section #1</Text>
</View>
<View style={styles.section}>
<Text>Section #2</Text>
</View>
</Page>
</Document>
);
Also in JavaScript:
- kotlin jsonobject from string
- anonymous function javascript
- clone an object javascript
- sublime text json formatter
- eyeshot javascript version
- react chart js 2 api data
- jquery how to get form value event.target
- javascript time interval
- node open file
- load node by id drupal 8
- find string element in an array mongodb
- count number of checkboxes in html jquery
- javascript null or empty
- how to convert a number to a string in javascript
- jquery add required
- json in uipath
- try/except js
- react native seperator code
- object to json javascript
- circle wave js
- ruby on rails test if all parameters in json request are here
- import json file in react native
- convertir lista a Json en Java
- sweet alert after click ok redirect