1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
| <?php
class AbsencePDF extends sfTCPDF
{
public function Header($title,$c) {
$this->SetTopMargin(2);
$this->SetLeftMargin(0);
$this->SetFillColor(204, 0, 1);
if($title=="Sommaire")
{
$this->MultiCell(30, 15, '', 0, 'L', 1, 0,0,2,'', '', true);
}
else
{
$this->MultiCell(30, 15, '', 0, 'L', 1, 0,'', '', true);
}
$this->SetFillColor(1, 64, 115);
$this->MultiCell(150, 15, '<div style="color:#FFFFFF;font-size:45px;text-align:left;">'.utf8_encode($title).'</div>', 0, 'L', 1, 0,'', '', true,true,true,true);
$this->SetFillColor(204, 0, 1);
$this->MultiCell(150, 15, '<div style="color:#FFFFFF;font-size:45px;text-align:left;">'.utf8_encode($c).'</div>', 0, 'L', 1, 0,'', '', true,true,true,true);
// Line break
$this->Ln(20);
}
// Page footer
public function Footer($title) {
// Position at 1.5 cm from bottom
$this->SetY(-10);
if($title=="Sommaire")
{
$this->MultiCell(30, 7, '', 0, 'L', 1, 0,0,2,'', '', true);
}
else
{
$this->MultiCell(30, 7, '', 0, 'L', 1, 0,'', '', true);
}
$this->SetFillColor(1, 64, 115);
$this->MultiCell(150, 7, '<div style="color:#FFFFFF;font-size:20px;text-align:left;">'.utf8_encode($title).'</div>', 0, 'L', 1, 0,'', '', true,true,true,true);
$this->SetFillColor(204, 0, 1);
$this->MultiCell(20, 7, '<div style="color:#000000;font-size:20px;text-align:left;">confidentiel</div>', 0, 'L', 1, 0,'', '', true,true,true,true);
$this->MultiCell(20, 7, '<div style="color:#FFFFFF;font-size:20px;text-align:left;">'.$this->getAliasNumPage().'/'.$this->getAliasNbPages().'</div>', 0, 'L', 1, 0,'', '', true,true,true,true);
}
}
?> |
Partager