summaryrefslogtreecommitdiff
path: root/public/app
diff options
context:
space:
mode:
Diffstat (limited to 'public/app')
-rw-r--r--public/app/views/js/pdf/application-styler.php191
-rw-r--r--public/app/views/js/pdf/penalty-styler.php0
-rw-r--r--public/app/views/templates/application.php169
3 files changed, 290 insertions, 70 deletions
diff --git a/public/app/views/js/pdf/application-styler.php b/public/app/views/js/pdf/application-styler.php
new file mode 100644
index 0000000..35077ef
--- /dev/null
+++ b/public/app/views/js/pdf/application-styler.php
@@ -0,0 +1,191 @@
+<!-- application pdf template
+ check: http://pdfmake.org/playground.html
+ // playground requires you to assign document definition to a variable called dd
+
+ var dd = {
+ content: [
+ 'APPLICATION:\n\n',
+ {
+ alignment: 'justify',
+ columns: [
+ {
+ text: [
+ 'NAME: My Name',
+ 'Father: I do',
+ 'Mother:Me too',
+ 'Specs: Some quite big Address Lorem ipsum dolor sit amet, consectetur adipisicing elit'
+ ].join('\n\n')
+ },
+ {
+ text:[
+ 'Lorem ipsum dolor sit amet, consectetur adipisicing elit.',
+ 'Malit profecta versatur nomine ocurreret multavit, officiis viveremus aeternum.',
+ 'Quando nostros congressus susceperant concederetur leguntur iam, vigiliae democritea tantopere causae.',
+ 'Atilii plerumque ipsas potitur pertineant multis rem quaeri pro, legendum didicisse credere ex maluisset per videtis.',
+ 'Cur discordans praetereat aliae ruinae dirigentur orestem eodem, praetermittenda divinum.',
+ 'Collegisti, deteriora malint loquuntur officii cotidie finitas referri doleamus ambigua acute.',
+ 'Adhaesiones ratione beate arbitraretur detractis perdiscere, constituant hostis polyaeno.',
+ 'Diu concederetur.'
+ ].join('\n')
+ }
+ ]
+ },
+ '\n\nOh, don\'t forget, we can use everything from styling examples (named styles, custom overrides) here as well.',
+ '\n\nWow, you\'ve read the whole document! Congratulations :D'
+ ],
+ styles: {
+ header: {
+ fontSize: 18,
+ bold: true
+ },
+ bigger: {
+ fontSize: 15,
+ italics: true
+ }
+ },
+ defaultStyle: {
+ columnGap: 20
+ }
+
+ }
+
+
+
+ --- also ---
+
+ var dd = {
+ content: [
+ {
+ text: 'This is a header with style',
+ style: 'header'
+ },
+
+ 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Confectum ponit legam, perferendis nomine miserum, animi. Moveat nesciunt triari naturam.\n\n',
+
+ 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Confectum ponit legam, perferendis nomine miserum, animi. Moveat nesciunt triari naturam posset, eveniunt specie deorsus efficiat sermone instituendarum fuisse veniat, eademque mutat debeo. Delectet plerique protervi diogenem dixerit logikh levius probabo adipiscuntur afficitur, factis magistra inprobitatem aliquo andriam obiecta, religionis, imitarentur studiis quam, clamat intereant vulgo admonitionem operis iudex stabilitas vacillare scriptum nixam, reperiri inveniri maestitiam istius eaque dissentias idcirco gravis, refert suscipiet recte sapiens oportet ipsam terentianus, perpauca sedatio aliena video.\n\n',
+
+ {
+ text: 'It is possible to apply multiple styles, by passing an array. This paragraph uses two styles: quote and small. When multiple styles are provided, they are evaluated in the specified order which is important in case they define the same properties',
+ style: ['quote', 'small']
+ }
+ ],
+ styles: {
+ header: {
+ fontSize: 18,
+ bold: true,
+ alignment: 'center'
+ },
+ subheader: {
+ fontSize: 15,
+ bold: true
+ },
+ quote: {
+ italics: true
+ },
+ small: {
+ fontSize: 8
+ }
+ }
+
+}
+-->
+
+
+
+<script>
+var source = {
+ first_name: 'George',
+ last_name: 'Its me!',
+ father_name: 'Pipis',
+ message: 'Adhaesiones ratione beate arbitraretur detractis perdiscere, constituant hostis polyaeno.',
+ constants: {
+ organization: 'Ministry of Nothing'
+ }
+}
+
+
+function designer(data) {
+ return {
+ content: [
+ {
+ text: 'ΑΙΤΗΣΗ\n\n',
+ style: 'header'
+ },
+ {
+ alignment: 'justify',
+ columns: [
+ {
+ width: 210,
+ text: ''
+ },
+ {
+ width: 'auto',
+ text:[
+ 'ΠΡΟΣ\n',
+ {
+ style: 'bigger',
+ text: data.constants.organization
+ }
+ ]
+ }
+ ]
+ },
+ {
+ alignment: 'justify',
+ columns: [
+ {
+ width: 210,
+ lineHeight: 1.5,
+ text: [
+ 'Όνομα: ', { style: 'bigger', text: data.first_name },
+ '\nΕπίθετο: ', { style: 'bigger', text: data.last_name },
+ '\nΌνομα πατρός: ',{ style: 'bigger', text: data.father_name },
+ '\nEmail: ', { style: 'bigger', text: data.email },
+ ]
+ },
+ {
+ width: 'auto',
+ lineHeight: 1.33,
+ text: [
+ '\n\n',
+ {
+ style: 'bigger',
+ text: data.message+'\n'
+ },
+ '\n\ndate: ',
+ '\n\nze Is',
+ '\n\n\n',
+ {
+ style: 'bigger',
+ text: data.last_name +' '+data.first_name
+ }
+ ]
+ }
+ ]
+ },
+ '\n\nOh, don\'t forget, we can use everything from styling examples (named styles, custom overrides) here as well.',
+ '\n\nWow, you\'ve read the whole document! Congratulations :D'
+ ],
+ styles: {
+ header: {
+ fontSize: 24,
+ bold: true,
+ alignment: 'center',
+ color: '#000'
+ },
+ bigger: {
+ fontSize: 15,
+ italics: false,
+ color: '#000'
+ }
+ },
+ defaultStyle: {
+ columnGap: 25,
+ fontSize: 13
+ }
+
+ };
+
+}
+
+var dd = designer(source);
diff --git a/public/app/views/js/pdf/penalty-styler.php b/public/app/views/js/pdf/penalty-styler.php
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/public/app/views/js/pdf/penalty-styler.php
diff --git a/public/app/views/templates/application.php b/public/app/views/templates/application.php
index 475dea1..6e36d00 100644
--- a/public/app/views/templates/application.php
+++ b/public/app/views/templates/application.php
@@ -107,97 +107,126 @@
Render::view('js/attachments-handling');
?>
-</html>
+<script>
+var source = {
+ first_name: 'George',
+ last_name: 'Its me!',
+ father_name: 'Pipis',
+ message: 'Adhaesiones ratione beate arbitraretur detractis perdiscere, constituant hostis polyaeno.',
+ constants: {
+ organization: 'Ministry of Nothing'
+ }
+}
-<!-- application pdf template
- check: http://pdfmake.org/playground.html
- // playground requires you to assign document definition to a variable called dd
- var dd = {
+function designer(data) {
+ return {
+ info: {
+ title: 'some-document',
+ author: 'name',
+ subject: 'theme',
+ keywords: 'petition type, year',
+ },
content: [
- 'APPLICATION:\n\n',
+ {
+ text: 'ΑΙΤΗΣΗ\n\n',
+ style: 'header'
+ },
{
alignment: 'justify',
columns: [
{
- text: [
- 'NAME: My Name',
- 'Father: I do',
- 'Mother:Me too',
- 'Specs: Some quite big Address Lorem ipsum dolor sit amet, consectetur adipisicing elit'
- ].join('\n\n')
+ width: 210,
+ text: ''
},
{
+ width: 'auto',
+ lineHeight: 1.35,
text:[
- 'Lorem ipsum dolor sit amet, consectetur adipisicing elit.',
- 'Malit profecta versatur nomine ocurreret multavit, officiis viveremus aeternum.',
- 'Quando nostros congressus susceperant concederetur leguntur iam, vigiliae democritea tantopere causae.',
- 'Atilii plerumque ipsas potitur pertineant multis rem quaeri pro, legendum didicisse credere ex maluisset per videtis.',
- 'Cur discordans praetereat aliae ruinae dirigentur orestem eodem, praetermittenda divinum.',
- 'Collegisti, deteriora malint loquuntur officii cotidie finitas referri doleamus ambigua acute.',
- 'Adhaesiones ratione beate arbitraretur detractis perdiscere, constituant hostis polyaeno.',
- 'Diu concederetur.'
- ].join('\n')
+ 'ΠΡΟΣ\n',
+ {
+ style: 'bigger',
+ text: data.constants.organization
+ }
+ ]
+ }
+ ]
+ },
+ {
+ alignment: 'justify',
+ columns: [
+ {
+ width: 210,
+ lineHeight: 1.5,
+ text: [
+ 'Όνομα: ', { style: 'bigger', text: data.first_name },
+ '\nΕπίθετο: ', { style: 'bigger', text: data.last_name },
+ '\nΌνομα πατρός: ',{ style: 'bigger', text: data.father_name },
+ '\nEmail: ', { style: 'bigger', text: data.email },
+ ]
+ },
+ {
+ width: 'auto',
+ lineHeight: 1.33,
+ text: [
+ '\n\n',
+ {
+ style: 'bigger',
+ text: data.message+'\n'
+ },
+ '\n\ndate: ',
+ '\n\nze Is',
+ '\n\n\n',
+ {
+ style: 'bigger',
+ text: data.last_name +' '+data.first_name
+ }
+ ]
}
]
},
- '\n\nOh, don\'t forget, we can use everything from styling examples (named styles, custom overrides) here as well.',
- '\n\nWow, you\'ve read the whole document! Congratulations :D'
+ '\n\n\n\nWow, you\'ve read the whole document! Congratulations :D'
],
+ footer: {
+ text: [
+ 'the document has been registered with number A124-2501-4589-4568-7 / 2023-12-15',
+ '\ndocument signature: <?=sha1(rand(1,1111))?>'
+
+ ],
+ style: 'signature'
+ },
styles: {
header: {
- fontSize: 18,
- bold: true
+ fontSize: 24,
+ bold: true,
+ alignment: 'center',
+ color: '#000'
},
bigger: {
- fontSize: 15,
- italics: true
+ fontSize: 13,
+ italics: false,
+ color: '#000'
+ },
+ signature: {
+ fontSize: 11,
+ italics: false,
+ alignment: 'center'
+
}
},
defaultStyle: {
- columnGap: 20
+ columnGap: 25,
+ fontSize: 12
}
-
- }
-
-
-
- --- also ---
-
- var dd = {
- content: [
- {
- text: 'This is a header with style',
- style: 'header'
- },
-
- 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Confectum ponit legam, perferendis nomine miserum, animi. Moveat nesciunt triari naturam.\n\n',
-
- 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Confectum ponit legam, perferendis nomine miserum, animi. Moveat nesciunt triari naturam posset, eveniunt specie deorsus efficiat sermone instituendarum fuisse veniat, eademque mutat debeo. Delectet plerique protervi diogenem dixerit logikh levius probabo adipiscuntur afficitur, factis magistra inprobitatem aliquo andriam obiecta, religionis, imitarentur studiis quam, clamat intereant vulgo admonitionem operis iudex stabilitas vacillare scriptum nixam, reperiri inveniri maestitiam istius eaque dissentias idcirco gravis, refert suscipiet recte sapiens oportet ipsam terentianus, perpauca sedatio aliena video.\n\n',
-
- {
- text: 'It is possible to apply multiple styles, by passing an array. This paragraph uses two styles: quote and small. When multiple styles are provided, they are evaluated in the specified order which is important in case they define the same properties',
- style: ['quote', 'small']
- }
- ],
- styles: {
- header: {
- fontSize: 18,
- bold: true,
- alignment: 'center'
- },
- subheader: {
- fontSize: 15,
- bold: true
- },
- quote: {
- italics: true
- },
- small: {
- fontSize: 8
- }
- }
-
+ };
}
---> \ No newline at end of file
+
+
+pdfMake.createPdf(designer(source)).open();
+// download (+title): .download('my-doc-title.pdf');
+// open in same window: .open({}, window);
+// print: .print();
+</script>
+
+</html>