gpt4 book ai didi

html - 每页的 tcpdf 颜色

转载 作者:行者123 更新时间:2023-11-28 03:06:52 26 4
gpt4 key购买 nike

我想在 tcpdf 中设置右边距的颜色。这是代码:

$bMargin = $pdf->getBreakMargin();

// get current auto-page-break mode

$auto_page_break = $pdf->getAutoPageBreak();

// disable auto-page-break

$pdf->SetAutoPageBreak(false, 0);

$pdf->Rect(0, 0, 10, 1000,'F',array(),array(199, 245, 206));

$pdf->SetAutoPageBreak($auto_page_break, $bMargin);

// set the starting point for the page content

$pdf->setPageMark();

问题是彩色右边距只出现在第一页上。我希望它显示在所有页面上。我该如何解决?

最佳答案

 class MYPDF extends TCPDF {

//Page header
public function Header() {
// Logo


$image_file = K_PATH_IMAGES.'logo_example.jpg';

//$this->Image($image_file, 10, 5, 15, '', 'JPG', '', 'T', false, 300, '', false, false, 0, false, false, false);

// Set font

$this->SetFont('helvetica', 'B', 20);

$this->Rect(0, 0, 1000, 10,'F',array(),array(199, 245, 206));

$this->SetTextColor(0, 0, 50);

// Title

$this->Cell(0, 15, 'mysite', 0, false, 'C', 0, '', 0, false, 'M', 'M');

$bMargin = $this->getBreakMargin();

// get current auto-page-break mode

$auto_page_break = $this->getAutoPageBreak();

// disable auto-page-break

$this->SetAutoPageBreak(false, 0);

$this->Rect(0, 0, 13, 1000,'F',array(),array(199, 205, 206));

$this->SetAutoPageBreak($auto_page_break, $bMargin);

// set the starting point for the page content

$this->setPageMark();

}

// Page footer
public function Footer() {
// Position at 15 mm from bottom
$this->SetY(-15);
// Set font

$this->SetFont('helvetica', 'I', 8);
$this->SetTextColor(150, 50, 50);
// Page number
$this->Cell(0, 10, 'Page '.$this->getAliasNumPage().'/'.$this->getAliasNbPages(), 0, false, 'C', 0, '', 0, false, 'T', 'M');
}

}

关于html - 每页的 tcpdf 颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32277633/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com