2012-11-01 1 views
1

THEAD 출력이 writeHTML 인 html 테이블이 테이블 상단의 모든 페이지에 표시되어야합니다. 그것은 작동하지만 FPDI에 의해로드 된 템플릿을 사용할 때 헤드는 흰색이고 두 번째 페이지에서 사라집니다. 마우스로 헤드 필드를 표시 할 수 있지만 흰색으로 표시됩니다. 테두리는 왼쪽에 작은 점으로 만 나타납니다.FPDI 템플릿 및 THEAD가있는 TCPDF

이미 메서드에 $this->setPageMark()을 추가하려고했습니다. 하지만 여전히 같은 문제입니다.

public function AddPage($orientation = '', $format = ''){ 
    parent::AddPage($orientation, $format); 
    if($this->template != null){ 
     $this->useTemplate($this->template); 
     $this->setPageMark(); 
    } 
} 

답변

0

처음에 페이지 나누기를 활성화해야 문제가 발생합니다. 이것은 샘플 코드 단편입니다.

require_once('tcpdf/tcpdf.php'); //main code  
require_once('tcpdf/fpdi.php'); //read existing pdf and sends to fpdf 
$pdf = new FPDI(); 
$pdf->setPrintHeader(false); //no header 
$pdf->setPrintFooter(false);//no footer  
$pdf->SetAutoPageBreak(FALSE, 0); // set auto page breaks 
//loop starts here 
{ 
    $pdf->setSourceFile($page_background); //set page                                        
    $templateId = $pdf->importPage(1); //we only need the first page                     
    $pdf->useTemplate($templateId);  //use the imported page 
    //your write html code and any other tcpdf related code comes here 
} 
$pdf->Output(outcome.pdf, 'I'); //use F instead of I to show generated pdf.