2015-04-28 70 views
0

我正在使用TCPDF生成我的pdf。我不知道重置起始頁碼。我的意思是,我將生成報告起始頁NUMER 3(不是1)在頁腳,但2(3,5,6,7等)TCPDF中的自定義頁碼

這裏是我的第二個代碼頁增量:

$_SESSION["hal"] = $_POST["hal"]; 
$_SESSION["f"] = $_POST["f"]; 


class MYPDF extends TCPDF { 

    // Page footer 
    public function Footer() { 

     // Position at 25 mm from bottom 
     $this->SetY(-25); 
     // Set font 

     $this->SetFont('helvetica', 'b', 8); 

     // Page number 

     $this->Cell(0, 15,$_SESSION["f"]." ". $_SESSION["hal"], 'T', false, 'R', 0, '', 0, false, 'T', 'M'); 
       $_SESSION["hal"]++; 
    } 
} 

有人能幫助請..

回答

0

完成..

$ _SESSION [ 「HAL」] = $ _ POST [ 「HAL」]; $ _SESSION [「f」] = $ _POST [「f」];

類MYPDF延伸TCPDF {

// Page footer 
public function Footer() { 

    // Position at 25 mm from bottom 
    $this->SetY(-25); 
    // Set font 

    $this->SetFont('helvetica', 'b', 8); 

    // Page number 
    //i add var to store current page 
    $halaman = $this->PageNo(); 
    $this->Cell(0, 15,$_SESSION["f"]." ". ($halaman+$_SESSION["hal"]), 'T', false, 'R', 0, '', 0, false, 'T', 'M'); 

} 

}