react-pdf-levelup 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -0
- package/fn/aggAlias.js +21 -0
- package/fn/moveComponents.js +129 -0
- package/fn/postinstall.js +66 -0
- package/fn/upVersion.js +12 -0
- package/fn/updateTsconfig.js +10 -0
- package/next.config.mjs +6 -0
- package/package.json +39 -0
- package/public/bg-login.jpg +0 -0
- package/public/codigo_guardado.js +1 -0
- package/public/css/style.css +751 -0
- package/public/dboard/logo.png +0 -0
- package/public/favicon.ico +0 -0
- package/public/fonts/TimesNewerRoman-Bold.otf +0 -0
- package/public/fonts/TimesNewerRoman-BoldItalic.otf +0 -0
- package/public/fonts/TimesNewerRoman-Italic.otf +0 -0
- package/public/fonts/TimesNewerRoman-Regular.otf +0 -0
- package/public/header-pdf.jpg +0 -0
- package/public/home/bgHome.jpg +0 -0
- package/public/home/bgHome2.jpg +0 -0
- package/public/home/download.jpg +0 -0
- package/public/home/undraw_elements_re_25t9.svg +1 -0
- package/public/home/undraw_project_completed_re_jr7u.svg +1 -0
- package/public/home/undraw_shared_goals_re_jvqd.svg +1 -0
- package/public/home/undraw_spread_love_re_v3cl.svg +1 -0
- package/public/home/undraw_target_re_fi8j.svg +1 -0
- package/public/home/undraw_visionary_technology_re_jfp7.svg +1 -0
- package/public/logo.png +0 -0
- package/public/marca/logo.svg +1 -0
- package/src/components/PDF/components/DocumentoTemplate.tsx +140 -0
- package/src/components/PDF/components/PDFContent.tsx +192 -0
- package/src/components/PDF/core/Etiquetas.tsx +152 -0
- package/src/components/PDF/core/Grid.tsx +101 -0
- package/src/components/PDF/core/Img.tsx +22 -0
- package/src/components/PDF/core/LayoutPDF.tsx +186 -0
- package/src/components/PDF/core/Listas.tsx +10 -0
- package/src/components/PDF/core/MakePDF.tsx +50 -0
- package/src/components/PDF/core/PageElements.tsx +50 -0
- package/src/components/PDF/core/Position.tsx +33 -0
- package/src/components/PDF/core/Tablet.tsx +121 -0
- package/src/components/PDF/core/index.tsx +56 -0
- package/src/components/PDF/lib/pdfParser.ts +620 -0
- package/src/components/PDF/services/apiService.ts +17 -0
- package/src/components/PDF/templates/AllTemplate.tsx +134 -0
- package/src/components/PDF/templates/BusinessCardTemplate.tsx +139 -0
- package/src/components/PDF/templates/CertificateTemplate.tsx +31 -0
- package/src/components/PDF/templates/HeaderFooterTemplate.tsx +61 -0
- package/src/components/PDF/templates/InvoiceTemplate.tsx +53 -0
- package/src/components/PDF/templates/ProposalTemplate.tsx +246 -0
- package/src/components/PDF/templates/ReportTemplate.tsx +57 -0
- package/src/components/PDF/templates/ResumeTemplate.tsx +170 -0
- package/src/components/PDF/templates/TablasTemplate.tsx +307 -0
- package/src/components/PDF/templates/index.ts +9 -0
- package/src/components/PDF/view/ColorPicker.tsx +147 -0
- package/src/components/PDF/view/Header.tsx +102 -0
- package/src/components/PDF/view/HomePDF.tsx +177 -0
- package/src/components/PDF/view/SettingsPanel.tsx +703 -0
- package/src/pages/AllTemplate.tsx +53 -0
- package/src/pages/Documento2.tsx +45 -0
- package/src/pages/_app.tsx +6 -0
- package/src/pages/_document.tsx +13 -0
- package/src/pages/api/generatePDF.ts +74 -0
- package/src/pages/api/hello.ts +13 -0
- package/src/pages/api/readFile.ts +18 -0
- package/src/pages/api/readTemplateFile.ts +26 -0
- package/src/pages/api/save.ts +22 -0
- package/src/pages/api/saveFile.ts +20 -0
- package/src/pages/index.tsx +13 -0
- package/src/pages/template/[template].tsx +250 -0
- package/tsconfig.json +63 -0
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
import type React from "react"
|
|
3
|
+
import { LayoutPDF, P, H4, H2, BR, Center, Span, Container, Row, Col4, Img, Table, Tbody, Thead, Td, Th, Tr } from "../core"
|
|
4
|
+
|
|
5
|
+
type AllTemplateProps = {}
|
|
6
|
+
|
|
7
|
+
const AllTemplate: React.FC<AllTemplateProps> = () => {
|
|
8
|
+
const data = {
|
|
9
|
+
info0: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Aliquam eaque repellat optio suscipit qui nobis adipisci perferendis animi dolor. Eveniet odit veritatis explicabo est possimus nisi fuga officia blanditiis expedita.",
|
|
10
|
+
info1: " Lorem ipsum dolor sit amet consectetur adipisicing elit. Aliquam eaque repellat optisuscipit qui nobis adipisci perferendis animi dolor. Eveniet odit veritatis explicabo est possimus nisi fuga officia blanditiis expedita.Lorem, ipsum dolor sit amet consectetur adipisicing elit. Repellat dolore labore iure sunt iste at qui aspernatur beatae quaerat non doloremque, nostrum, hic asperiores eius quae nulla. Ducimus, non culpa!",
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const departmentData = [
|
|
14
|
+
{ departamento: "Marketing", responsable: "Juan Pérez", presupuesto: "$25,000" },
|
|
15
|
+
{ departamento: "Ventas", responsable: "María García", presupuesto: "$35,000" },
|
|
16
|
+
{ departamento: "Desarrollo", responsable: "Carlos López", presupuesto: "$45,000" },
|
|
17
|
+
]
|
|
18
|
+
|
|
19
|
+
const financialSummaryData = [
|
|
20
|
+
{ categoria: "Ventas", ingresos: "$50,000", gastos: "$10,000", balance: "$40,000" },
|
|
21
|
+
{ categoria: "Inversiones", ingresos: "$20,000", gastos: "$5,000", balance: "$15,000" },
|
|
22
|
+
{ categoria: "Total", ingresos: "", gastos: "", balance: "$55,000", isBold: true, color: "#4CAF50" },
|
|
23
|
+
]
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<LayoutPDF size="A4" orientation="portrait" padding={72} showPageNumbers={false}>
|
|
27
|
+
<Center style={{ marginBottom: "10px" }}>
|
|
28
|
+
<H4>Template Parrafos</H4>
|
|
29
|
+
</Center>
|
|
30
|
+
|
|
31
|
+
<P>{data.info0}</P>
|
|
32
|
+
|
|
33
|
+
<P style={{ textAlign: "justify", borderWidth: "1", padding: "10px" }}>{data.info1}</P>
|
|
34
|
+
|
|
35
|
+
<BR></BR>
|
|
36
|
+
|
|
37
|
+
<Center style={{ borderWidth: "1", padding: "10px" }}>
|
|
38
|
+
<P>
|
|
39
|
+
<Span style={{ color: "#FF5733" }}>Lorem ipsum</Span>
|
|
40
|
+
<Span style={{ color: "#FFC300" }}>dolor sit</Span>
|
|
41
|
+
<Span style={{ color: "#33FF57" }}>amet consectetur</Span>
|
|
42
|
+
<Span style={{ color: "#33AFFF" }}>adipisicing elit</Span>.
|
|
43
|
+
<Span style={{ color: "#8D33FF" }}>Aliquam eaque</Span>
|
|
44
|
+
<Span style={{ color: "#FF33A8" }}>repellat optio</Span>
|
|
45
|
+
<Span style={{ color: "#33FFF3" }}>suscipit qui nobis</Span>
|
|
46
|
+
<Span style={{ color: "#FF8C33" }}>adipisci perferendis</Span>
|
|
47
|
+
<Span style={{ color: "#A833FF" }}>animi dolor</Span>.
|
|
48
|
+
<Span style={{ color: "#33FF8C" }}>Eveniet odit</Span>
|
|
49
|
+
<Span style={{ color: "#FF3333" }}>veritatis explicabo</Span>
|
|
50
|
+
<Span style={{ color: "#339FFF" }}>est possimus</Span>
|
|
51
|
+
<Span style={{ color: "#FF9933" }}>nisi fuga</Span>
|
|
52
|
+
<Span style={{ color: "#C733FF" }}>officia blanditiis</Span>
|
|
53
|
+
<Span style={{ color: "#33FF57" }}>expedita</Span>.
|
|
54
|
+
</P>
|
|
55
|
+
</Center>
|
|
56
|
+
|
|
57
|
+
<BR></BR>
|
|
58
|
+
|
|
59
|
+
<P style={{ backgroundColor: "#ffe38f" }}>
|
|
60
|
+
Lorem ipsum dolor sit amet consectetur adipisicing elit. Aliquam eaque repellat optio suscipit qui nobis adipisci perferendis animi dolor. Eveniet odit veritatis explicabo est possimus nisi fuga officia blanditiis expedita.
|
|
61
|
+
</P>
|
|
62
|
+
|
|
63
|
+
<BR></BR>
|
|
64
|
+
|
|
65
|
+
<Center>
|
|
66
|
+
<Img src="https://avatars.githubusercontent.com/u/37651665?v=4" alt="Lights" style={{ width: "200", borderRadius: "300", alignSelf: 'center' }}></Img>
|
|
67
|
+
</Center>
|
|
68
|
+
|
|
69
|
+
<BR></BR>
|
|
70
|
+
<BR></BR>
|
|
71
|
+
<Container>
|
|
72
|
+
<Row>
|
|
73
|
+
<Col4 style={{ backgroundColor: "#20c997", borderRadius: "5" }}>
|
|
74
|
+
<P>t sdfdsfsdfdsfsddddddddddddddddd nisi fuga officia blanditiis expedita.</P>
|
|
75
|
+
</Col4>
|
|
76
|
+
|
|
77
|
+
<Col4 style={{ backgroundColor: "#17a2b8", borderRadius: "5" }}>
|
|
78
|
+
<P>t possimus nisi fuga officia blanditiis expedita.</P>
|
|
79
|
+
</Col4>
|
|
80
|
+
<Col4 style={{ backgroundColor: "#20c997", borderRadius: "5" }}>
|
|
81
|
+
<P>t possimus nisi fuga officia blanditiis expedita.</P>
|
|
82
|
+
</Col4>
|
|
83
|
+
</Row>
|
|
84
|
+
</Container>
|
|
85
|
+
|
|
86
|
+
<BR></BR>
|
|
87
|
+
<BR></BR>
|
|
88
|
+
|
|
89
|
+
<H2 style={{ marginTop: 20 }}>Tabla con estilos personalizados</H2>
|
|
90
|
+
<Table style={{ borderColor: "#3366cc", borderWidth: 1 }}>
|
|
91
|
+
<Thead>
|
|
92
|
+
<Tr>
|
|
93
|
+
<Th style={{ backgroundColor: "#3366cc", color: "white" }}>Departamento</Th>
|
|
94
|
+
<Th style={{ backgroundColor: "#3366cc", color: "white" }}>Responsable</Th>
|
|
95
|
+
<Th style={{ backgroundColor: "#3366cc", color: "white" }}>Presupuesto</Th>
|
|
96
|
+
</Tr>
|
|
97
|
+
</Thead>
|
|
98
|
+
<Tbody>
|
|
99
|
+
{departmentData.map((row, index) => (
|
|
100
|
+
<Tr key={index}>
|
|
101
|
+
<Td>{row.departamento}</Td>
|
|
102
|
+
<Td>{row.responsable}</Td>
|
|
103
|
+
<Td>{row.presupuesto}</Td>
|
|
104
|
+
</Tr>
|
|
105
|
+
))}
|
|
106
|
+
</Tbody>
|
|
107
|
+
</Table>
|
|
108
|
+
|
|
109
|
+
<H2 style={{ marginBottom: 20 }}>Resumen Financiero</H2>
|
|
110
|
+
<Table>
|
|
111
|
+
<Thead>
|
|
112
|
+
<Tr>
|
|
113
|
+
<Th style={{ backgroundColor: "#4CAF50", color: "white" }}>Categoría</Th>
|
|
114
|
+
<Th style={{ backgroundColor: "#4CAF50", color: "white" }}>Ingresos</Th>
|
|
115
|
+
<Th style={{ backgroundColor: "#4CAF50", color: "white" }}>Gastos</Th>
|
|
116
|
+
<Th style={{ backgroundColor: "#4CAF50", color: "white" }}>Balance</Th>
|
|
117
|
+
</Tr>
|
|
118
|
+
</Thead>
|
|
119
|
+
<Tbody>
|
|
120
|
+
{financialSummaryData.map((row, index) => (
|
|
121
|
+
<Tr key={index}>
|
|
122
|
+
<Td style={row.isBold ? { fontWeight: "bold" } : {}}>{row.categoria}</Td>
|
|
123
|
+
<Td>{row.ingresos}</Td>
|
|
124
|
+
<Td>{row.gastos}</Td>
|
|
125
|
+
<Td style={row.isBold ? { fontWeight: "bold", color: row.color } : { fontWeight: "bold" }}>{row.balance}</Td>
|
|
126
|
+
</Tr>
|
|
127
|
+
))}
|
|
128
|
+
</Tbody>
|
|
129
|
+
</Table>
|
|
130
|
+
</LayoutPDF>
|
|
131
|
+
)
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export default AllTemplate
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
import type React from "react"
|
|
3
|
+
import { LayoutPDF } from "../core"
|
|
4
|
+
import { StyleSheet, View, Text } from "@react-pdf/renderer"
|
|
5
|
+
|
|
6
|
+
const styles = StyleSheet.create({
|
|
7
|
+
card: {
|
|
8
|
+
position: "relative",
|
|
9
|
+
height: "100%",
|
|
10
|
+
backgroundColor: "#ffffff",
|
|
11
|
+
borderRadius: 5,
|
|
12
|
+
overflow: "hidden",
|
|
13
|
+
},
|
|
14
|
+
colorBar: {
|
|
15
|
+
position: "absolute",
|
|
16
|
+
top: 0,
|
|
17
|
+
left: 0,
|
|
18
|
+
width: "100%",
|
|
19
|
+
height: 20,
|
|
20
|
+
backgroundColor: "#3498db",
|
|
21
|
+
},
|
|
22
|
+
content: {
|
|
23
|
+
padding: 20,
|
|
24
|
+
paddingTop: 30,
|
|
25
|
+
display: "flex",
|
|
26
|
+
flexDirection: "column",
|
|
27
|
+
height: "100%",
|
|
28
|
+
},
|
|
29
|
+
header: {
|
|
30
|
+
marginBottom: 15,
|
|
31
|
+
},
|
|
32
|
+
name: {
|
|
33
|
+
fontSize: 16,
|
|
34
|
+
fontWeight: "bold",
|
|
35
|
+
color: "#2c3e50",
|
|
36
|
+
},
|
|
37
|
+
title: {
|
|
38
|
+
fontSize: 10,
|
|
39
|
+
color: "#7f8c8d",
|
|
40
|
+
marginTop: 2,
|
|
41
|
+
},
|
|
42
|
+
company: {
|
|
43
|
+
fontSize: 12,
|
|
44
|
+
fontWeight: "bold",
|
|
45
|
+
color: "#3498db",
|
|
46
|
+
marginTop: 5,
|
|
47
|
+
},
|
|
48
|
+
contactInfo: {
|
|
49
|
+
marginTop: 10,
|
|
50
|
+
},
|
|
51
|
+
contactRow: {
|
|
52
|
+
flexDirection: "row",
|
|
53
|
+
alignItems: "center",
|
|
54
|
+
marginBottom: 5,
|
|
55
|
+
},
|
|
56
|
+
contactLabel: {
|
|
57
|
+
fontSize: 8,
|
|
58
|
+
color: "#7f8c8d",
|
|
59
|
+
width: 30,
|
|
60
|
+
},
|
|
61
|
+
contactText: {
|
|
62
|
+
fontSize: 8,
|
|
63
|
+
color: "#2c3e50",
|
|
64
|
+
},
|
|
65
|
+
footer: {
|
|
66
|
+
marginTop: "auto",
|
|
67
|
+
borderTopWidth: 1,
|
|
68
|
+
borderTopColor: "#ecf0f1",
|
|
69
|
+
paddingTop: 5,
|
|
70
|
+
},
|
|
71
|
+
website: {
|
|
72
|
+
fontSize: 8,
|
|
73
|
+
color: "#3498db",
|
|
74
|
+
textAlign: "center",
|
|
75
|
+
},
|
|
76
|
+
logoContainer: {
|
|
77
|
+
position: "absolute",
|
|
78
|
+
bottom: 10,
|
|
79
|
+
right: 10,
|
|
80
|
+
width: 40,
|
|
81
|
+
height: 40,
|
|
82
|
+
backgroundColor: "#ecf0f1",
|
|
83
|
+
borderRadius: 20,
|
|
84
|
+
display: "flex",
|
|
85
|
+
alignItems: "center",
|
|
86
|
+
justifyContent: "center",
|
|
87
|
+
},
|
|
88
|
+
logoText: {
|
|
89
|
+
fontSize: 14,
|
|
90
|
+
fontWeight: "bold",
|
|
91
|
+
color: "#3498db",
|
|
92
|
+
},
|
|
93
|
+
})
|
|
94
|
+
|
|
95
|
+
const BusinessCardTemplate: React.FC = () => {
|
|
96
|
+
return (
|
|
97
|
+
<LayoutPDF width={252} height={144} padding={0}>
|
|
98
|
+
<View style={styles.card}>
|
|
99
|
+
<View style={styles.colorBar} />
|
|
100
|
+
|
|
101
|
+
<View style={styles.content}>
|
|
102
|
+
<View style={styles.header}>
|
|
103
|
+
<Text style={styles.name}>Juan Pérez</Text>
|
|
104
|
+
<Text style={styles.title}>Desarrollador Full Stack</Text>
|
|
105
|
+
<Text style={styles.company}>TECH SOLUTIONS</Text>
|
|
106
|
+
</View>
|
|
107
|
+
|
|
108
|
+
<View style={styles.contactInfo}>
|
|
109
|
+
<View style={styles.contactRow}>
|
|
110
|
+
<Text style={styles.contactLabel}>Tel:</Text>
|
|
111
|
+
<Text style={styles.contactText}>+1 (555) 123-4567</Text>
|
|
112
|
+
</View>
|
|
113
|
+
|
|
114
|
+
<View style={styles.contactRow}>
|
|
115
|
+
<Text style={styles.contactLabel}>Email:</Text>
|
|
116
|
+
<Text style={styles.contactText}>juan.perez@techsolutions.com</Text>
|
|
117
|
+
</View>
|
|
118
|
+
|
|
119
|
+
<View style={styles.contactRow}>
|
|
120
|
+
<Text style={styles.contactLabel}>Dir:</Text>
|
|
121
|
+
<Text style={styles.contactText}>123 Calle Tecnología, Ciudad Tech</Text>
|
|
122
|
+
</View>
|
|
123
|
+
</View>
|
|
124
|
+
|
|
125
|
+
<View style={styles.footer}>
|
|
126
|
+
<Text style={styles.website}>www.techsolutions.com</Text>
|
|
127
|
+
</View>
|
|
128
|
+
</View>
|
|
129
|
+
|
|
130
|
+
<View style={styles.logoContainer}>
|
|
131
|
+
<Text style={styles.logoText}>TS</Text>
|
|
132
|
+
</View>
|
|
133
|
+
</View>
|
|
134
|
+
</LayoutPDF>
|
|
135
|
+
)
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export default BusinessCardTemplate
|
|
139
|
+
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
import type React from "react"
|
|
3
|
+
import { LayoutPDF, P, H1, H2, Center } from "../core"
|
|
4
|
+
|
|
5
|
+
const CertificateTemplate: React.FC = () => {
|
|
6
|
+
return (
|
|
7
|
+
<LayoutPDF>
|
|
8
|
+
<Center>
|
|
9
|
+
<H1 style={{ color: "#4a4a4a", marginBottom: 20 }}>Certificado de Logro</H1>
|
|
10
|
+
|
|
11
|
+
<P style={{ fontSize: 14, marginBottom: 40 }}>Este certificado se otorga a</P>
|
|
12
|
+
|
|
13
|
+
<H2 style={{ color: "#2c3e50", marginBottom: 40 }}>Juan Pérez</H2>
|
|
14
|
+
|
|
15
|
+
<P style={{ fontSize: 14, marginBottom: 20 }}>por haber completado exitosamente el curso de</P>
|
|
16
|
+
|
|
17
|
+
<H2 style={{ color: "#2c3e50", marginBottom: 40 }}>Desarrollo Web Avanzado</H2>
|
|
18
|
+
|
|
19
|
+
<P style={{ fontSize: 14, marginBottom: 60 }}>con una duración de 120 horas</P>
|
|
20
|
+
|
|
21
|
+
<P style={{ fontSize: 12 }}>Fecha de emisión: {new Date().toLocaleDateString()}</P>
|
|
22
|
+
|
|
23
|
+
<P style={{ fontSize: 12, marginTop: 80 }}>_________________________</P>
|
|
24
|
+
<P style={{ fontSize: 12 }}>Firma del Director</P>
|
|
25
|
+
</Center>
|
|
26
|
+
</LayoutPDF>
|
|
27
|
+
)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export default CertificateTemplate
|
|
31
|
+
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
import type React from "react"
|
|
3
|
+
import { LayoutPDF, P, H1, H2, Span, Header, Footer } from "../core"
|
|
4
|
+
|
|
5
|
+
const HeaderFooterTemplate: React.FC = () => {
|
|
6
|
+
return (
|
|
7
|
+
<LayoutPDF size="A4" orientation="portrait" padding={72}>
|
|
8
|
+
{/* Header que aparecerá en todas las páginas */}
|
|
9
|
+
<Header fixed={true} style={{ backgroundColor: "#f0f0f0", padding: 10 }}>
|
|
10
|
+
DOCUMENTO CONFIDENCIAL
|
|
11
|
+
</Header>
|
|
12
|
+
|
|
13
|
+
<H1>Documento con Header y Footer</H1>
|
|
14
|
+
|
|
15
|
+
<P>
|
|
16
|
+
Este documento muestra cómo usar las nuevas etiquetas{" "}
|
|
17
|
+
<Span style={{ fontWeight: "bold", color: "blue" }}>Span</Span>,
|
|
18
|
+
<Span style={{ fontWeight: "bold", color: "red" }}> Header </Span>y{" "}
|
|
19
|
+
<Span style={{ fontWeight: "bold", color: "green" }}>Footer</Span>.
|
|
20
|
+
</P>
|
|
21
|
+
|
|
22
|
+
<H2>Uso de Span</H2>
|
|
23
|
+
<P>
|
|
24
|
+
La etiqueta Span permite <Span style={{ color: "red" }}>aplicar estilos</Span> a partes específicas del texto{" "}
|
|
25
|
+
<Span style={{ textDecoration: "underline" }}>sin afectar</Span> al resto del contenido.
|
|
26
|
+
</P>
|
|
27
|
+
|
|
28
|
+
<H2>Uso de Header y Footer</H2>
|
|
29
|
+
<P>
|
|
30
|
+
Las etiquetas Header y Footer permiten agregar contenido en la parte superior e inferior de cada página. Si se
|
|
31
|
+
les pasa la prop "fixed", aparecerán en todas las páginas del documento.
|
|
32
|
+
</P>
|
|
33
|
+
|
|
34
|
+
<P>
|
|
35
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam auctor, nisl eget ultricies tincidunt, nisl nisl
|
|
36
|
+
aliquam nisl, eget aliquam nisl nisl eget nisl. Nullam auctor, nisl eget ultricies tincidunt, nisl nisl aliquam
|
|
37
|
+
nisl, eget aliquam nisl nisl eget nisl.
|
|
38
|
+
</P>
|
|
39
|
+
|
|
40
|
+
<P>
|
|
41
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam auctor, nisl eget ultricies tincidunt, nisl nisl
|
|
42
|
+
aliquam nisl, eget aliquam nisl nisl eget nisl. Nullam auctor, nisl eget ultricies tincidunt, nisl nisl aliquam
|
|
43
|
+
nisl, eget aliquam nisl nisl eget nisl.
|
|
44
|
+
</P>
|
|
45
|
+
|
|
46
|
+
<P>
|
|
47
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam auctor, nisl eget ultricies tincidunt, nisl nisl
|
|
48
|
+
aliquam nisl, eget aliquam nisl nisl eget nisl. Nullam auctor, nisl eget ultricies tincidunt, nisl nisl aliquam
|
|
49
|
+
nisl, eget aliquam nisl nisl eget nisl.
|
|
50
|
+
</P>
|
|
51
|
+
|
|
52
|
+
{/* Footer que aparecerá en todas las páginas */}
|
|
53
|
+
<Footer fixed={true} style={{ borderTop: "1px solid #ccc", paddingTop: 5 }}>
|
|
54
|
+
<Span style={{ fontSize: 8 }}>© 2025 - Todos los derechos reservados</Span>
|
|
55
|
+
</Footer>
|
|
56
|
+
</LayoutPDF>
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export default HeaderFooterTemplate
|
|
61
|
+
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
import type React from "react"
|
|
3
|
+
import { LayoutPDF, P, H1, Table, Thead, Tbody, Tr, Th, Td, H2 } from "../core"
|
|
4
|
+
|
|
5
|
+
const InvoiceTemplate: React.FC = () => {
|
|
6
|
+
return (
|
|
7
|
+
<LayoutPDF>
|
|
8
|
+
<H1>Factura</H1>
|
|
9
|
+
<P>Factura No: INV-001</P>
|
|
10
|
+
<P>Fecha: {new Date().toLocaleDateString()}</P>
|
|
11
|
+
|
|
12
|
+
<H2>Detalles del cliente</H2>
|
|
13
|
+
<P>Nombre: John Doe</P>
|
|
14
|
+
<P>Dirección: 123 Calle Principal, Ciudad</P>
|
|
15
|
+
|
|
16
|
+
<Table>
|
|
17
|
+
<Thead>
|
|
18
|
+
<Tr isFirst>
|
|
19
|
+
<Th>Descripción</Th>
|
|
20
|
+
<Th>Cantidad</Th>
|
|
21
|
+
<Th>Precio unitario</Th>
|
|
22
|
+
<Th>Total</Th>
|
|
23
|
+
</Tr>
|
|
24
|
+
</Thead>
|
|
25
|
+
<Tbody>
|
|
26
|
+
<Tr index={0}>
|
|
27
|
+
<Td>Producto A</Td>
|
|
28
|
+
<Td>2</Td>
|
|
29
|
+
<Td>$50.00</Td>
|
|
30
|
+
<Td>$100.00</Td>
|
|
31
|
+
</Tr>
|
|
32
|
+
<Tr index={1}>
|
|
33
|
+
<Td>Producto B</Td>
|
|
34
|
+
<Td>1</Td>
|
|
35
|
+
<Td>$75.00</Td>
|
|
36
|
+
<Td>$75.00</Td>
|
|
37
|
+
</Tr>
|
|
38
|
+
<Tr index={2}>
|
|
39
|
+
<Td style={{ fontWeight: "bold" }}>Total</Td>
|
|
40
|
+
<Td></Td>
|
|
41
|
+
<Td></Td>
|
|
42
|
+
<Td style={{ fontWeight: "bold" }}>$175.00</Td>
|
|
43
|
+
</Tr>
|
|
44
|
+
</Tbody>
|
|
45
|
+
</Table>
|
|
46
|
+
|
|
47
|
+
<P style={{ marginTop: 20 }}>Gracias por su compra.</P>
|
|
48
|
+
</LayoutPDF>
|
|
49
|
+
)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export default InvoiceTemplate
|
|
53
|
+
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
import type React from "react"
|
|
3
|
+
import { LayoutPDF } from "../core"
|
|
4
|
+
import { StyleSheet, View, Text } from "@react-pdf/renderer"
|
|
5
|
+
|
|
6
|
+
const styles = StyleSheet.create({
|
|
7
|
+
header: {
|
|
8
|
+
flexDirection: "row",
|
|
9
|
+
justifyContent: "space-between",
|
|
10
|
+
alignItems: "center",
|
|
11
|
+
marginBottom: 30,
|
|
12
|
+
paddingBottom: 20,
|
|
13
|
+
borderBottomWidth: 2,
|
|
14
|
+
borderBottomColor: "#3498db",
|
|
15
|
+
},
|
|
16
|
+
headerLeft: {
|
|
17
|
+
flex: 1,
|
|
18
|
+
},
|
|
19
|
+
headerRight: {
|
|
20
|
+
flex: 1,
|
|
21
|
+
alignItems: "flex-end",
|
|
22
|
+
},
|
|
23
|
+
companyName: {
|
|
24
|
+
fontSize: 24,
|
|
25
|
+
fontWeight: "bold",
|
|
26
|
+
color: "#2c3e50",
|
|
27
|
+
},
|
|
28
|
+
companyInfo: {
|
|
29
|
+
fontSize: 10,
|
|
30
|
+
color: "#7f8c8d",
|
|
31
|
+
marginTop: 5,
|
|
32
|
+
},
|
|
33
|
+
title: {
|
|
34
|
+
fontSize: 28,
|
|
35
|
+
fontWeight: "bold",
|
|
36
|
+
color: "#2c3e50",
|
|
37
|
+
marginBottom: 20,
|
|
38
|
+
textAlign: "center",
|
|
39
|
+
},
|
|
40
|
+
section: {
|
|
41
|
+
marginBottom: 20,
|
|
42
|
+
},
|
|
43
|
+
sectionTitle: {
|
|
44
|
+
fontSize: 16,
|
|
45
|
+
fontWeight: "bold",
|
|
46
|
+
color: "#2c3e50",
|
|
47
|
+
marginBottom: 10,
|
|
48
|
+
backgroundColor: "#ecf0f1",
|
|
49
|
+
padding: 8,
|
|
50
|
+
},
|
|
51
|
+
text: {
|
|
52
|
+
fontSize: 11,
|
|
53
|
+
color: "#2c3e50",
|
|
54
|
+
lineHeight: 1.6,
|
|
55
|
+
marginBottom: 10,
|
|
56
|
+
},
|
|
57
|
+
table: {
|
|
58
|
+
marginTop: 10,
|
|
59
|
+
marginBottom: 20,
|
|
60
|
+
},
|
|
61
|
+
tableHeader: {
|
|
62
|
+
backgroundColor: "#3498db",
|
|
63
|
+
color: "white",
|
|
64
|
+
},
|
|
65
|
+
tableCell: {
|
|
66
|
+
padding: 8,
|
|
67
|
+
fontSize: 10,
|
|
68
|
+
},
|
|
69
|
+
highlight: {
|
|
70
|
+
backgroundColor: "#e8f6ff",
|
|
71
|
+
},
|
|
72
|
+
footer: {
|
|
73
|
+
position: "absolute",
|
|
74
|
+
bottom: 30,
|
|
75
|
+
left: 0,
|
|
76
|
+
right: 0,
|
|
77
|
+
textAlign: "center",
|
|
78
|
+
fontSize: 10,
|
|
79
|
+
color: "#7f8c8d",
|
|
80
|
+
paddingTop: 10,
|
|
81
|
+
borderTopWidth: 1,
|
|
82
|
+
borderTopColor: "#bdc3c7",
|
|
83
|
+
},
|
|
84
|
+
timeline: {
|
|
85
|
+
marginTop: 10,
|
|
86
|
+
marginBottom: 20,
|
|
87
|
+
},
|
|
88
|
+
timelineItem: {
|
|
89
|
+
flexDirection: "row",
|
|
90
|
+
marginBottom: 10,
|
|
91
|
+
},
|
|
92
|
+
timelineDate: {
|
|
93
|
+
width: 100,
|
|
94
|
+
fontSize: 10,
|
|
95
|
+
fontWeight: "bold",
|
|
96
|
+
color: "#3498db",
|
|
97
|
+
},
|
|
98
|
+
timelineContent: {
|
|
99
|
+
flex: 1,
|
|
100
|
+
fontSize: 10,
|
|
101
|
+
color: "#2c3e50",
|
|
102
|
+
},
|
|
103
|
+
pricing: {
|
|
104
|
+
marginTop: 20,
|
|
105
|
+
padding: 15,
|
|
106
|
+
backgroundColor: "#f8f9fa",
|
|
107
|
+
borderRadius: 5,
|
|
108
|
+
},
|
|
109
|
+
pricingItem: {
|
|
110
|
+
flexDirection: "row",
|
|
111
|
+
justifyContent: "space-between",
|
|
112
|
+
marginBottom: 8,
|
|
113
|
+
},
|
|
114
|
+
pricingLabel: {
|
|
115
|
+
fontSize: 11,
|
|
116
|
+
color: "#2c3e50",
|
|
117
|
+
},
|
|
118
|
+
pricingValue: {
|
|
119
|
+
fontSize: 11,
|
|
120
|
+
fontWeight: "bold",
|
|
121
|
+
color: "#2c3e50",
|
|
122
|
+
},
|
|
123
|
+
total: {
|
|
124
|
+
marginTop: 10,
|
|
125
|
+
paddingTop: 10,
|
|
126
|
+
borderTopWidth: 1,
|
|
127
|
+
borderTopColor: "#bdc3c7",
|
|
128
|
+
flexDirection: "row",
|
|
129
|
+
justifyContent: "space-between",
|
|
130
|
+
},
|
|
131
|
+
totalLabel: {
|
|
132
|
+
fontSize: 12,
|
|
133
|
+
fontWeight: "bold",
|
|
134
|
+
color: "#2c3e50",
|
|
135
|
+
},
|
|
136
|
+
totalValue: {
|
|
137
|
+
fontSize: 12,
|
|
138
|
+
fontWeight: "bold",
|
|
139
|
+
color: "#3498db",
|
|
140
|
+
},
|
|
141
|
+
})
|
|
142
|
+
|
|
143
|
+
const ProposalTemplate: React.FC = () => {
|
|
144
|
+
return (
|
|
145
|
+
<LayoutPDF>
|
|
146
|
+
{/* Header */}
|
|
147
|
+
<View style={styles.header}>
|
|
148
|
+
<View style={styles.headerLeft}>
|
|
149
|
+
<Text style={styles.companyName}>TechSolutions Inc.</Text>
|
|
150
|
+
<Text style={styles.companyInfo}>
|
|
151
|
+
123 Innovation Drive{"\n"}
|
|
152
|
+
Silicon Valley, CA 94025{"\n"}
|
|
153
|
+
(555) 123-4567{"\n"}
|
|
154
|
+
contact@techsolutions.com
|
|
155
|
+
</Text>
|
|
156
|
+
</View>
|
|
157
|
+
<View style={styles.headerRight}>
|
|
158
|
+
<Text style={styles.companyInfo}>
|
|
159
|
+
Proposal #: PRO-2024-001{"\n"}
|
|
160
|
+
Date: March 7, 2024{"\n"}
|
|
161
|
+
Valid until: April 7, 2024
|
|
162
|
+
</Text>
|
|
163
|
+
</View>
|
|
164
|
+
</View>
|
|
165
|
+
|
|
166
|
+
<Text style={styles.title}>Website Redesign Proposal</Text>
|
|
167
|
+
|
|
168
|
+
{/* Executive Summary */}
|
|
169
|
+
<View style={styles.section}>
|
|
170
|
+
<Text style={styles.sectionTitle}>Executive Summary</Text>
|
|
171
|
+
<Text style={styles.text}>
|
|
172
|
+
TechSolutions Inc. is pleased to present this comprehensive proposal for the redesign of your corporate
|
|
173
|
+
website. Our solution will modernize your online presence, improve user experience, and drive better business
|
|
174
|
+
results through enhanced digital engagement.
|
|
175
|
+
</Text>
|
|
176
|
+
</View>
|
|
177
|
+
|
|
178
|
+
{/* Project Scope */}
|
|
179
|
+
<View style={styles.section}>
|
|
180
|
+
<Text style={styles.sectionTitle}>Project Scope</Text>
|
|
181
|
+
<Text style={styles.text}>
|
|
182
|
+
• Complete redesign of corporate website{"\n"}• Mobile-responsive implementation{"\n"}• Integration with
|
|
183
|
+
existing CMS{"\n"}• SEO optimization{"\n"}• Performance optimization{"\n"}• Analytics implementation
|
|
184
|
+
</Text>
|
|
185
|
+
</View>
|
|
186
|
+
|
|
187
|
+
{/* Timeline */}
|
|
188
|
+
<View style={styles.section}>
|
|
189
|
+
<Text style={styles.sectionTitle}>Project Timeline</Text>
|
|
190
|
+
<View style={styles.timeline}>
|
|
191
|
+
<View style={styles.timelineItem}>
|
|
192
|
+
<Text style={styles.timelineDate}>Week 1-2</Text>
|
|
193
|
+
<Text style={styles.timelineContent}>Discovery and Planning Phase</Text>
|
|
194
|
+
</View>
|
|
195
|
+
<View style={styles.timelineItem}>
|
|
196
|
+
<Text style={styles.timelineDate}>Week 3-6</Text>
|
|
197
|
+
<Text style={styles.timelineContent}>Design and Development</Text>
|
|
198
|
+
</View>
|
|
199
|
+
<View style={styles.timelineItem}>
|
|
200
|
+
<Text style={styles.timelineDate}>Week 7-8</Text>
|
|
201
|
+
<Text style={styles.timelineContent}>Testing and Refinement</Text>
|
|
202
|
+
</View>
|
|
203
|
+
<View style={styles.timelineItem}>
|
|
204
|
+
<Text style={styles.timelineDate}>Week 9</Text>
|
|
205
|
+
<Text style={styles.timelineContent}>Launch and Training</Text>
|
|
206
|
+
</View>
|
|
207
|
+
</View>
|
|
208
|
+
</View>
|
|
209
|
+
|
|
210
|
+
{/* Pricing */}
|
|
211
|
+
<View style={styles.section}>
|
|
212
|
+
<Text style={styles.sectionTitle}>Investment</Text>
|
|
213
|
+
<View style={styles.pricing}>
|
|
214
|
+
<View style={styles.pricingItem}>
|
|
215
|
+
<Text style={styles.pricingLabel}>Website Design and Development</Text>
|
|
216
|
+
<Text style={styles.pricingValue}>$25,000</Text>
|
|
217
|
+
</View>
|
|
218
|
+
<View style={styles.pricingItem}>
|
|
219
|
+
<Text style={styles.pricingLabel}>Content Migration</Text>
|
|
220
|
+
<Text style={styles.pricingValue}>$5,000</Text>
|
|
221
|
+
</View>
|
|
222
|
+
<View style={styles.pricingItem}>
|
|
223
|
+
<Text style={styles.pricingLabel}>SEO Optimization</Text>
|
|
224
|
+
<Text style={styles.pricingValue}>$3,500</Text>
|
|
225
|
+
</View>
|
|
226
|
+
<View style={styles.pricingItem}>
|
|
227
|
+
<Text style={styles.pricingLabel}>Training and Documentation</Text>
|
|
228
|
+
<Text style={styles.pricingValue}>$1,500</Text>
|
|
229
|
+
</View>
|
|
230
|
+
<View style={styles.total}>
|
|
231
|
+
<Text style={styles.totalLabel}>Total Investment</Text>
|
|
232
|
+
<Text style={styles.totalValue}>$35,000</Text>
|
|
233
|
+
</View>
|
|
234
|
+
</View>
|
|
235
|
+
</View>
|
|
236
|
+
|
|
237
|
+
{/* Footer */}
|
|
238
|
+
<Text style={styles.footer}>
|
|
239
|
+
This proposal is confidential and valid for 30 days. Terms and conditions apply.
|
|
240
|
+
</Text>
|
|
241
|
+
</LayoutPDF>
|
|
242
|
+
)
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
export default ProposalTemplate
|
|
246
|
+
|