AddFont('DejaVu','','dejavusans.php',true); $this->AddFont('DejaVu','B','dejavusansb.php',true); $this->AddFont('DejaVu','BI','dejavusansbi.php',true); $this->AddFont('DejaVuCond','','dejavusanscondensed.php',true); $this->AddFont('DejaVuCond','B','dejavusanscondensedb.php',true); date_default_timezone_set ('Europe/Paris'); $this->cn = $p_cn; $this->own = new own($this->cn); $this->soc = $this->own->MY_NAME; $this->date = date('d.m.Y'); } function setDossierInfo($dossier = "n/a") { $this->dossier = dossier::name()." ".$dossier; } function Header() { //Arial bold 12 $this->SetFont('DejaVu', 'B', 12); //Title $this->Cell(0,10,$this->dossier, 'B', 0, 'C'); //Line break $this->Ln(20); } function Footer() { //Position at 2 cm from bottom $this->SetY(-20); //Arial italic 8 $this->SetFont('Arial', 'I', 8); //Page number $this->Cell(0,8,'Date '.$this->date." - Page ".$this->PageNo().'/{nb}',0,0,'C'); $this->Ln(3); // Created by PhpCompta $this->Cell(0,8,'Created by Phpcompta, the most professional opensource accounting software http://www.phpcompta.eu',0,0,'C',false,'http://www.phpcompta.eu'); } function Cell ($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=false, $link='') { $txt = str_replace("\\", "", $txt); return parent::Cell($w, $h, $txt, $border, $ln, $align, $fill, $link); } } class PDFLand extends PDF { public function __construct ($p_cn = null, $orientation = 'P', $unit = 'mm', $format = 'A4') { if($p_cn == null) die("No database connection. Abort."); parent::SFPDF('L', $unit, $format); $this->AddFont('DejaVu','','dejavusans.php',true); $this->AddFont('DejaVu','B','dejavusansb.php',true); $this->AddFont('DejaVu','BI','dejavusansbi.php',true); $this->AddFont('DejaVuCond','','dejavusanscondensed.php',true); $this->AddFont('DejaVuCond','B','dejavusanscondensedb.php',true); date_default_timezone_set ('Europe/Paris'); $this->cn = $p_cn; $this->own = new own($this->cn); $this->soc = $this->own->MY_NAME; $this->date = date('d.m.Y'); } function Header() { //Arial bold 12 $this->SetFont('DejaVu', 'B', 10); //Title $this->Cell(0,10,$this->dossier, 'B', 0, 'C'); //Line break $this->Ln(20); } function Footer() { //Position at 2 cm from bottom $this->SetY(-20); //Arial italic 8 $this->SetFont('Arial', 'I', 8); //Page number $this->Cell(0,8,'Date '.$this->date." - Page ".$this->PageNo().'/{nb}',0,0,'C'); $this->Ln(3); // Created by PhpCompta $this->Cell(0,8,'Created by Phpcompta, the most professional opensource accounting software http://www.phpcompta.eu',0,0,'C',false,'http://www.phpcompta.eu'); } } class PDFBalance_simple extends PDF { /** *@brief set_info(dossier,from poste,to poste, from periode, to periode) *@param $p_from_poste start = poste *@param $p_to_poste end = poste *@param $p_from periode start *@param $p_to periode end */ function set_info($p_from_poste,$to_poste,$p_from,$p_to) { $this->dossier='Balance simple '.dossier::name(); $this->from_poste=$p_from_poste; $this->to_poste=$to_poste; $this->from=$p_from; $this->to=$p_to; } function Header() { parent::Header(); $this->SetFont('DejaVu','B',8); $titre=sprintf("Balance simple poste %s %s date %s %s", $this->from_poste, $this->to_poste, $this->from, $this->to); $this->Cell(0,7,$titre,1,0,'C'); $this->Ln(); $this->SetFont('DejaVu','',6); $this->Cell(20,7,'id','B'); $this->Cell(90,7,'Poste Comptable','B'); $this->Cell(20,7,'Débit','B',0,'L'); $this->Cell(20,7,'Crédit','B',0,'L'); $this->Cell(20,7,'Solde','B',0,'L'); $this->Cell(20,7,'D/C','B',0,'L'); $this->Ln(); } }