Commit | Line | Data |
---|---|---|
6a488035 | 1 | <?php |
0cf587a7 EM |
2 | |
3 | /** | |
4 | * Class CRM_Event_Badge_Logo5395 | |
5 | */ | |
6a488035 | 6 | class CRM_Event_Badge_Logo5395 extends CRM_Event_Badge { |
90b461f1 | 7 | |
0cf587a7 | 8 | /** |
0cf587a7 | 9 | */ |
00be9182 | 10 | public function __construct() { |
6a488035 TO |
11 | parent::__construct(); |
12 | // A4 | |
353ffa53 TO |
13 | $pw = 210; |
14 | $ph = 297; | |
15 | $h = 59.2; | |
16 | $w = 85.7; | |
be2fb01f | 17 | $this->format = [ |
0479b4c8 | 18 | 'name' => 'Avery 5395', |
353ffa53 TO |
19 | 'paper-size' => 'A4', |
20 | 'metric' => 'mm', | |
21 | 'lMargin' => 13.5, | |
0479b4c8 | 22 | 'tMargin' => 3, |
353ffa53 TO |
23 | 'NX' => 2, |
24 | 'NY' => 4, | |
25 | 'SpaceX' => 15, | |
26 | 'SpaceY' => 8.5, | |
0479b4c8 | 27 | 'width' => $w, |
353ffa53 TO |
28 | 'height' => $h, |
29 | 'font-size' => 12, | |
be2fb01f | 30 | ]; |
6a488035 TO |
31 | $this->lMarginLogo = 20; |
32 | $this->tMarginName = 20; | |
33 | // $this->setDebug (); | |
34 | } | |
35 | ||
0cf587a7 | 36 | /** |
fa3fdebc | 37 | * @param array $participant |
0cf587a7 | 38 | */ |
6a488035 TO |
39 | public function generateLabel($participant) { |
40 | $x = $this->pdf->GetAbsX(); | |
41 | $y = $this->pdf->GetY(); | |
42 | $this->printBackground(TRUE); | |
be2fb01f | 43 | $this->pdf->SetLineStyle([ |
90b461f1 SL |
44 | 'width' => 0.1, |
45 | 'cap' => 'round', | |
46 | 'join' => 'round', | |
47 | 'dash' => '2,2', | |
48 | 'color' => [0, 0, 200], | |
49 | ]); | |
6a488035 TO |
50 | |
51 | $this->pdf->SetFontSize(9); | |
52 | $this->pdf->MultiCell($this->pdf->width - $this->lMarginLogo, 0, $participant['event_title'], $this->border, "L", 0, 1, $x + $this->lMarginLogo, $y); | |
53 | ||
54 | $this->pdf->SetXY($x, $y + $this->pdf->height - 5); | |
55 | $date = CRM_Utils_Date::customFormat($participant['event_start_date'], "%e %b"); | |
56 | $this->pdf->Cell($this->pdf->width, 0, $date, $this->border, 2, "R"); | |
57 | ||
58 | $this->pdf->SetFontSize(20); | |
59 | $this->pdf->MultiCell($this->pdf->width, 10, $participant['display_name'], $this->border, "C", 0, 1, $x, $y + $this->tMarginName); | |
60 | $this->pdf->SetFontSize(15); | |
61 | $this->pdf->MultiCell($this->pdf->width, 0, $participant['current_employer'], $this->border, "C", 0, 1, $x, $this->pdf->getY()); | |
62 | } | |
96025800 | 63 | |
6a488035 | 64 | } |