Browse code

Update remote

Benjamin Roth authored on29/03/2023 11:42:08
Showing1 changed files
... ...
@@ -41,8 +41,8 @@ class AFPDF extends \TCPDF {
41 41
         $this->SetAutoPageBreak($auto_page_break, $bMargin);
42 42
         $this->SetMargins(0,0,0);
43 43
         $this->SetFooterMargin(0);
44
-        $this->Image(TL_ROOT . '/files/base/layout/img/mail/header_mail.png', 15, 35,180,0,'','','T',true,300);
45
-        $this->Image(TL_ROOT . '/files/base/layout/img/mail/logo_mail.png', 75, 10,60,0,'PNG','','T',true,300);
44
+        $this->Image(TL_ROOT . '/files/base/layout/img/pdf/header_expertise.jpg', 0,30,210,0,'','','T',true,300);
45
+        $this->Image(TL_ROOT . '/files/base/layout/img/pdf/logo.png', 75, 10,60,0,'PNG','','T',true,300);
46 46
         $this->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
47 47
         $this->SetFooterMargin(PDF_MARGIN_FOOTER);
48 48
     }
... ...
@@ -64,14 +64,17 @@ class AFPDF extends \TCPDF {
64 64
         $this->SetMargins(0,0,0);
65 65
         $this->SetFooterMargin(0);
66 66
 
67
-        $this->SetDrawColor(29,94,65);
68
-        $this->SetLineWidth(0.5);
69
-        $this->Line(15, 277, 195, 277, 'F');
67
+//        $this->SetDrawColor(29,94,65);
68
+//        $this->SetLineWidth(0.5);
69
+//        $this->Line(15, 277, 195, 277, 'F');
70
+        $this->Rect(0,277,210,20,"F",array(),array(29,94,65));
70 71
 
71 72
 
72
-        $this->SetTextColor(29,94,65);
73
-        $this->SetXY(15, 277);
74
-        $this->CreateCell(180, 10, 'www.affentaler.de', 0, 15, '', 'C', PDF_FONT_NAME_DATA);
73
+        $this->SetTextColor(255,255,255);
74
+        $this->SetXY(15, 282);
75
+        $this->CreateCell(180, 10, 'www.affentaler.de', 0, 10, '', 'R', PDF_FONT_NAME_DATA);
76
+        $this->ImageSVG(TL_ROOT . '/files/base/layout/img/scroll-logo.svg', 100, 282,0,10);
77
+
75 78
 
76 79
 //        $this->Image(TL_ROOT . '/files/themes/gengenbach_v1/assets/images/pdf/expertise_papier_footer.jpg', 0, 278,210,0,'JPG','','T',true,300);
77 80
         $this->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
Browse code

Update

Benjamin Roth authored on28/03/2023 09:47:26
Showing1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,230 @@
1
+<?php
2
+
3
+/**
4
+ * viabook platform for Contao Open Source CMS
5
+ *
6
+ * Copyright (C) 2012-2014 eSalesMedia
7
+ *
8
+ * @package    eSM_viabook
9
+ * @link       http://www.esales-media.de
10
+ * @license    commercial
11
+ *
12
+ * @author     Benjamin Roth <benjamin@esales-media.de>
13
+ */
14
+
15
+
16
+/**
17
+ * Namespace
18
+ */
19
+namespace eSM_isotope_custom\Pdf;
20
+
21
+/**
22
+ * Include required tcpdf config files
23
+ */
24
+
25
+require_once(TL_ROOT . '/system/modules/eSM_isotope_custom/config/af_tcpdf.php');
26
+require_once(TL_ROOT . '/vendor/tecnickcom/tcpdf/tcpdf.php');
27
+
28
+class AFPDF extends \TCPDF {
29
+
30
+    public function Header()
31
+    {
32
+        // Header
33
+        // get the current page break margin
34
+        $bMargin = $this->getBreakMargin();
35
+        // get current auto-page-break mode
36
+        $auto_page_break = $this->getAutoPageBreak();
37
+        // disable auto-page-break
38
+        $this->SetAutoPageBreak(false, 0);
39
+        // set bacground image
40
+        // restore auto-page-break status
41
+        $this->SetAutoPageBreak($auto_page_break, $bMargin);
42
+        $this->SetMargins(0,0,0);
43
+        $this->SetFooterMargin(0);
44
+        $this->Image(TL_ROOT . '/files/base/layout/img/mail/header_mail.png', 15, 35,180,0,'','','T',true,300);
45
+        $this->Image(TL_ROOT . '/files/base/layout/img/mail/logo_mail.png', 75, 10,60,0,'PNG','','T',true,300);
46
+        $this->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
47
+        $this->SetFooterMargin(PDF_MARGIN_FOOTER);
48
+    }
49
+
50
+
51
+    // Page footer
52
+    public function Footer()
53
+    {
54
+        // Footer
55
+        // get the current page break margin
56
+        $bMargin = $this->getBreakMargin();
57
+        // get current auto-page-break mode
58
+        $auto_page_break = $this->getAutoPageBreak();
59
+        // disable auto-page-break
60
+        $this->SetAutoPageBreak(false, 0);
61
+        // set bacground image
62
+        // restore auto-page-break status
63
+        $this->SetAutoPageBreak($auto_page_break, $bMargin);
64
+        $this->SetMargins(0,0,0);
65
+        $this->SetFooterMargin(0);
66
+
67
+        $this->SetDrawColor(29,94,65);
68
+        $this->SetLineWidth(0.5);
69
+        $this->Line(15, 277, 195, 277, 'F');
70
+
71
+
72
+        $this->SetTextColor(29,94,65);
73
+        $this->SetXY(15, 277);
74
+        $this->CreateCell(180, 10, 'www.affentaler.de', 0, 15, '', 'C', PDF_FONT_NAME_DATA);
75
+
76
+//        $this->Image(TL_ROOT . '/files/themes/gengenbach_v1/assets/images/pdf/expertise_papier_footer.jpg', 0, 278,210,0,'JPG','','T',true,300);
77
+        $this->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
78
+        $this->SetFooterMargin(PDF_MARGIN_FOOTER);
79
+    }
80
+
81
+    public function CreateTextBox($textval, $x = 0, $y = 0, $width = 0, $height = 0, $fontsize = PDF_FONT_SIZE_MAIN, $fontstyle = '', $align = 'L', $font = PDF_FONT_NAME_MAIN)
82
+    {
83
+        $margins = $this->getMargins();
84
+        $this->SetFont($font, $fontstyle, $fontsize);
85
+
86
+        if (!strlen($y))
87
+        {
88
+            $this->SetX($x+$margins['left']);
89
+        } else {
90
+            $this->SetXY($x+$margins['left'], $y);
91
+        }
92
+
93
+        // Start clipping.
94
+        $this->StartTransform();
95
+
96
+        if (!strlen($y))
97
+        {
98
+            $x = $x+$margins['left'];
99
+            $y = $y+$margins['top'];
100
+            $this->SetXY($x, $y);
101
+        } else {
102
+            $x = $x+$margins['left'];
103
+            $this->SetX($x);
104
+        }
105
+
106
+        if (!$height)
107
+        {
108
+            $pdf2 = clone $this;
109
+            $pdf2->setPrintHeader(false);
110
+            $pdf2->setPrintFooter(false);
111
+            $pdf2->AddPage();
112
+            $pdf2->Cell($width, $height, $textval, 0, false, $align);
113
+            $height = $pdf2->GetY();
114
+            unset($pdf2);
115
+        }
116
+
117
+        // Draw clipping rectangle to match cell.
118
+        $this->Rect($x, $y, $width, $height, 'CNZ');
119
+
120
+        $this->Cell($width, $height, $textval, 0, false, $align);
121
+
122
+        // Stop clipping.
123
+        $this->StopTransform();
124
+    }
125
+
126
+    public function lbr($fltNo=1)
127
+    {
128
+        $this->SetY($this->GetY()+(($this->getFontSize()*$this->getCellHeightRatio())*floatval($fltNo)));
129
+    }
130
+
131
+    public function CreateHTMLBox($htmlVal, $x = 0, $y = 0, $width = 0, $height = 0, $fontsize = PDF_FONT_SIZE_MAIN, $fontstyle = '', $align = 'L', $font = PDF_FONT_NAME_MAIN)
132
+    {
133
+        $margins = $this->getMargins();
134
+        $this->SetFont($font, $fontstyle, $fontsize);
135
+
136
+        // Start clipping.
137
+        $this->StartTransform();
138
+
139
+        if (!strlen($y))
140
+        {
141
+            $x = $x+$margins['left'];
142
+            $y = $y+$margins['top'];
143
+        } else {
144
+            $x = $x+$margins['left'];
145
+        }
146
+
147
+        if (!$height)
148
+        {
149
+            $pdf2 = clone $this;
150
+            $pdf2->setPrintHeader(false);
151
+            $pdf2->setPrintFooter(false);
152
+            $pdf2->AddPage();
153
+            $pdf2->writeHTMLCell($width, $height, 0, 0, $htmlVal, 0, 1, false, true, $align);
154
+            $height = $pdf2->GetY();
155
+            unset($pdf2);
156
+        }
157
+
158
+        // Draw clipping rectangle to match html cell.
159
+        $this->Rect($x, $y, $width, $height, 'CNZ');
160
+
161
+        // Output html.
162
+        $this->writeHTMLCell($width, $height, $x, $y, $htmlVal, 0, 0, false, true, $align);
163
+
164
+        // Stop clipping.
165
+        $this->StopTransform();
166
+    }
167
+
168
+
169
+    public function CreateCell($w, $h = 0, $txt = '', $ln = 0, $fontsize = PDF_FONT_SIZE_MAIN, $fontstyle = '', $align = 'L', $font = PDF_FONT_NAME_MAIN)
170
+    {
171
+        $margins = $this->getMargins();
172
+        $currFontsize = $this->getFontSize();
173
+        $currFontfamily = $this->getFontFamily();
174
+        $currFontstyle = $this->getFontStyle();
175
+
176
+        $x = $this->GetX();
177
+        $y = $this->GetY();
178
+
179
+        $this->SetFont($font, $fontstyle, $fontsize);
180
+
181
+        // Start clipping.
182
+        $this->StartTransform();
183
+
184
+        if (!$h)
185
+        {
186
+            $h = ($this->getFontSize()*$this->getCellHeightRatio());
187
+        }
188
+
189
+        // Draw clipping rectangle to match html cell.
190
+        $this->Rect($x, $y, $w, $h, 'CNZ');
191
+
192
+        $this->Cell($w,$h,$txt,0,$ln,$align);
193
+        $this->SetFont($currFontfamily, $currFontstyle, $currFontsize);
194
+
195
+        // Stop clipping.
196
+        $this->StopTransform();
197
+
198
+        if (!$ln)
199
+        {
200
+            $this->SetY($this->GetY());
201
+        }
202
+    }
203
+
204
+    public function CreateMultiCell($w, $h = 0, $txt = '', $ln = 0, $fontsize = PDF_FONT_SIZE_MAIN, $fontstyle = '', $align = 'L', $font = PDF_FONT_NAME_MAIN)
205
+    {
206
+        $currFontsize = $this->getFontSize();
207
+        $currFontfamily = $this->getFontFamily();
208
+        $currFontstyle = $this->getFontStyle();
209
+
210
+        $this->SetFont($font, $fontstyle, $fontsize);
211
+
212
+        if (!$h)
213
+        {
214
+            $pdf2 = clone $this;
215
+            $pdf2->setPrintHeader(false);
216
+            $pdf2->setPrintFooter(false);
217
+            $pdf2->AddPage();
218
+            $pdf2->MultiCell($w,$h,$txt,0,$align,false,1,0,0);
219
+            $h = $pdf2->GetY();
220
+            unset($pdf2);
221
+        }
222
+
223
+        $this->MultiCell($w,$h,$txt,0,$align,false,$ln);
224
+        if (!$ln)
225
+        {
226
+            $this->SetY($this->GetY()+$h-($this->getFontSize()*$this->getCellHeightRatio()));
227
+        }
228
+//        $this->SetFont($currFontfamily, $currFontstyle, $currFontsize);
229
+    }
230
+}
0 231
\ No newline at end of file