noalyss Version-9
pdf_land.class.php
Go to the documentation of this file.
1<?php
2
3/*
4 * This file is part of NOALYSS.
5 *
6 * NOALYSS is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * NOALYSS is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with NOALYSS; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19*/
20
21// Copyright Author Dany De Bontridder danydb@noalyss.eu
22
23/**
24 * @file
25 * @brief PDF in landscape mode
26 */
27
28/**
29 * @class PDFLand
30 * @brief PDF in landscape mode
31 */
32class PDFLand extends PDF
33{
34
35 public function __construct ($p_cn = null, $orientation = 'L', $unit = 'mm', $format = 'A4')
36 {
37
38 if($p_cn == null) die("No database connection. Abort.");
39 $this->bigger=0;
40
41 parent::__construct($p_cn,'L', $unit, $format);
42 date_default_timezone_set ('Europe/Paris');
43 $this->AddFont('DejaVu','','DejaVuSans.ttf',true);
44 $this->AddFont('DejaVu','B','DejaVuSans-Bold.ttf',true);
45 $this->AddFont('DejaVu','BI','DejaVuSans-BoldOblique.ttf',true);
46 $this->AddFont('DejaVuCond','','DejaVuSansCondensed.ttf',true);
47 $this->AddFont('DejaVuCond','B','DejaVuSansCondensed-Bold.ttf',true);
48 $this->AddFont('DejaVuCond','I','DejaVuSansCondensed-Oblique.ttf',true);
49
50 $this->cn = $p_cn;
51 $this->own = new Noalyss_Parameter_Folder($this->cn);
52 $this->soc = $this->own->MY_NAME;
53 $this->date = date('d.m.Y');
54 }
55 function Header()
56 {
57 //Arial bold 12
58 $this->SetFont('DejaVu', 'B', 10);
59 //Title
60 $this->Cell(0,10,$this->dossier, 'B', 0, 'C');
61 //Line break
62 $this->Ln(20);
63 }
64 function Footer()
65 {
66 //Position at 2 cm from bottom
67 $this->SetY(-20);
68 //Arial italic 8
69 $this->SetFont('DejaVuCond', 'I', 8);
70 //Page number
71 $this->Cell(0,8,'Date '.$this->date." - Page ".$this->PageNo().'/{nb}',0,0,'C');
72 $this->Ln(3);
73 // Created by NOALYSS
74 $this->Cell(0,8,'Created by NOALYSS, online on https://www.noalyss.eu',0,0,'C',false,'https://www.noalyss.eu');
75
76 }
77}
$input_from cn
Definition: balance.inc.php:66
Class to manage the company parameter (address, name...)
API for creating PDF, unicode, based on tfpdf.
Definition: pdf.class.php:34
PDF in landscape mode.
__construct($p_cn=null, $orientation='L', $unit='mm', $format='A4')