PHP FPDF фиксированный боковой столбец, который отображается в каждом заголовке страницы, как - PullRequest
0 голосов
/ 10 октября 2018

я пытаюсь создать PDF-файл.файл имеет верхний и нижний колонтитулы, теперь я должен поместить фиксированный столбец, в котором я буду отображать некоторые значения и должен отображаться на каждой странице, как поведение верхнего и нижнего колонтитула

что я сделал, я пыталсяРасширение может заголовок до самой нижней части моего документа, затем я установил мой Y в начало страницы, чтобы перекрыть заголовок, первая страница отображается нормально, но на следующей странице нет.

function Header(){
    $this->AddFont('Century Gothic','B','gothicb.php');
    $this->AddFont('Century Gothic','','century_gothic.php');
    $this->SetFont('Century Gothic','BU',10);

    $this->setDrawColor(189, 195, 199);
    $this->Cell(155,35,'',1,0,'L');
    if($this->PageNo() == 1){
        $this->Image($GLOBALS['imgurl'], $this->GetX(), $this->GetY(), 43,43);
    }
    $this->Cell(45,45,'ssdffds',1,0,'L');
    $this->Ln(35);

    $this->Cell(10,5,'',1,0);
    $this->Cell(98.9,5,$GLOBALS['student'],1,0);
    $this->SetFont('Century Gothic','U',10);
    $this->Cell(20,5,'',1,0);
    $this->Cell(30,5,$GLOBALS['idno'],1,0);
    $this->Ln();
    $this->Cell(20,4,'',1,0);
    $this->Cell(88.9,4,$GLOBALS['address'],1,0);
    $this->Cell(20,4,'',1,0);
    $this->Cell(30,4,$GLOBALS['sex'],1,0);
    $this->Ln();
    $this->Cell(20,4,'',1,0);
    $this->Cell(88.9,4,$GLOBALS['birthplace'],1,0);
    $this->Cell(20,4,'',1,0);
    $this->Cell(30,4,$GLOBALS['dateofbirth'],1,0);
    $this->Ln();
    $this->Cell(20,5,'',1,0);
    $this->Cell(0,5,$GLOBALS['course'],1,0);
    $this->Ln();
    $this->Cell(20,4,'',1,0);
    $this->Cell(88.9,4,$GLOBALS['entrydata'],1,0);
    $this->Cell(35,4,'',1,0);
    $this->Cell(0,6,$GLOBALS['admissiondate'],1,0);
    $this->Ln();
    $this->Cell(40,5,'',1,0);
    $this->Cell(68.9,5,'',1,0);
    $this->Cell(35,6,'',1,0);
    $this->Cell(0,6,'sample',1,0);
    $this->Ln();
    $this->Cell(25,4,'',1,0);
    $this->Cell(0,4,'March 29, 2011',1,0);
    $this->Ln();
    $this->Cell(0,1,'',1,0);
    $this->Ln();
    $this->Cell(30.6,5,'SUBJECT CODE',1,0,'C');
    $this->Cell(100,5,'DESCRIPTIVE TITLE',1,0,'C');
    $this->Cell(12,5,'GRADE',1,0,'C');
    $this->Cell(12,5,'CG',1,0,'C');
    $this->Cell(10,5,'UNITS',1,0,'C');
    $this->Cell(40.3,5,'',1,0,'C');
    $this->Ln();
    for ($i=0; $i <= 40; $i++) { 
        $this->Cell(164.6,5,'',0,0,'C');
        if($i == 23){
            $this->Cell(40.3,5,'display something',1,0,'C');
        }else{
            $this->Cell(40.3,5,'',1,0,'C');
        }

        $this->Ln();
    }

}

это мой код заголовка.ниже приведены примеры изображений: серая рамка - это мой заголовок, а черная - это содержимое this is my first page

enter image description here

это кодв начале отображения моего контента

$pdf = new PDF('P','mm',array(215.9,330.2));
$pdf->SetMargins(3,9,8,12.2);
$pdf->SetAutoPageBreak(true, 40);
$pdf->AliasNbPages();
$pdf->AddPage();
$pdf->AddFont('Century Gothic','B','gothicb.php');
$pdf->AddFont('Century Gothic','','century_gothic.php');
$pdf->isFinished = false;
$pdf->SetFont('Century Gothic','',10);
$pdf->SetY(84);  
...