diff options
author | MikunoNaka <bokuwakanojogahoshii@yahoo.com> | 2021-07-12 10:42:05 +0530 |
---|---|---|
committer | MikunoNaka <bokuwakanojogahoshii@yahoo.com> | 2021-07-12 10:42:05 +0530 |
commit | 10dbff87243b91fb4e50a86f1ec4cc30d5c63dc0 (patch) | |
tree | 85b40fce49df4102100500ffc69fb7eab1005542 /src/components/Print/PrintableDoc.tsx | |
parent | 9d941b5d99621bc98df0be3002aa7121f98e7a56 (diff) |
implemented sleek way to handle generating PDFs
Diffstat (limited to 'src/components/Print/PrintableDoc.tsx')
-rw-r--r-- | src/components/Print/PrintableDoc.tsx | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/components/Print/PrintableDoc.tsx b/src/components/Print/PrintableDoc.tsx new file mode 100644 index 0000000..bcabcbc --- /dev/null +++ b/src/components/Print/PrintableDoc.tsx @@ -0,0 +1,39 @@ +/* + * OpenBills - Self hosted browser app to generate and keep track of simple invoices + * Version - 0 + * Licensed under the MIT license - https://opensource.org/licenses/MIT + * + * Copyright (c) 2021 Vidhu Kant Sharma +*/ + +import React, { /*useState,*/ } from "react"; +import { Page, Text, View, Document, StyleSheet } from '@react-pdf/renderer'; + +const styles = StyleSheet.create({ + page: { + flexDirection: 'row', + backgroundColor: '#E4E4E4' + }, + section: { + margin: 10, + padding: 10, + flexGrow: 1 + } +}); + +const PrintableDoc: React.FC = () => { + return ( + <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> + ); +} + +export default PrintableDoc; |