【发布时间】:2017-07-19 20:44:55
【问题描述】:
我正在使用 TCPPDF ,我正在尝试添加具有不同样式的自定义页脚,例如右侧 Customer Name: 颜色应为蓝色,左侧 Approved By: 颜色应为绿色,底部显示页码的页面。
我已经在 pdf 页面中尝试过这个
$html_content = "<table><tr><td>Customer Name:</td><td style='color:blue;'>Suneel</td><td>Approved By:</td><td style='color:green;'>Srinu</td></tr></table></hr>"
$tcpdf->xfootertext($html_content);
它正在工作,但它不接受样式
在 TCPDF 类中
function Footer()
{
$year = date('Y');
$footertext = sprintf($this->xfootertext, $year);
$this->writeHTMLCell(0, 0, '', '', $footertext, 0, 0, false,true, "L", true);
$this->SetY(8);
// Set font
$this->SetFont('helvetica', 'I', 8);
// Page number
$this->Cell(0, 27, 'Page '.$this->getAliasNumPage().'/'.$this->getAliasNbPages(), 0, false, 'C', 0, '', 0, false, 'T', 'M');
}
【问题讨论】: