Ejemplo n.º 1
0
    public function Header()
    {
        $pdf = $this;
        $pdf->SetFont('freeserif', '', 7);
        $pdf->SetMargins(5, 5, 5);
        $i = $pdf->getPage();
        $companyName = App_Env::getCompanyName();
        $userFullName = App_Env::getUserFullName();
        $curentDate = App_Env::getCurrentDate();
        $caption = $this->caption;
        if ($pdf->CurOrientation == 'L') {
            $width = '80%';
        } else {
            $width = '70%';
        }
        $html = <<<HTML
<table   style="width: 100%;" width="100%" >
<tr><td style="width:{$width};border: none;text-align:left; ">{$companyName}</td>
    <td style="width: 50px;border: none;text-align: right;">Print Date:</td>
    <td style="width: 150px;border: none;text-align: right; ">{$curentDate}</td></tr>
<tr><td style="border: none;">{$caption}</td>
    <td style="width: 50px;border: none;text-align: right;">Print by:</td>
    <td style="width: 150px;border: none;text-align: right;">{$userFullName}</td></tr>
</table>
HTML;
        $pdf->writeHTML($html, true, true, false, false, '');
    }