我正在尝试让我的标志显示在标题和中心。我使用的是Cakephp,我的徽标文件是kki.jpg,它保存在TCPDF文件夹的图像文件夹下,TCPDF也保存在供应商文件夹中,PDF工作正常,这也在配置中定义如下:
define ('K_PATH_IMAGES', '/images/');下面是我的代码:
$tcpdf->SetAuthor("Likeslomakkeet");
$tcpdf->SetAutoPageBreak( true, $footerHeight );
//$tcpdf->SetTopMargin(10);
$tcpdf->setHeaderFont(array($textfont,'',30));
//$tcpdf->SetMargins(20, 30);
$tcpdf->SetHeaderData("kki.jpg", PDF_HEADER_LOGO_WIDTH, "Application PDF", "Likeslomakkeet - www.likeslomakkeet.net");
$tcpdf->xheadercolor = array(238,238,238);
$tcpdf->xheadertext = '';
$tcpdf->xfootertext = 'Copyright © %d Likeslomakkeet. All rights reserved.';
$tcpdf->AddPage();
$tcpdf->SetTextColor(0, 0, 0);
$tcpdf->SetFont($textfont,'',14);我无法让徽标显示在我的标题中。有什么原因吗?
顺便说一下,这是在view_pdf.ctp文件下...
发布于 2013-08-27 18:57:34
在相同的配置文件中编写此代码。
define ('PDF_HEADER_LOGO', 'kki.jpg');发布于 2019-12-18 17:06:34
tcpdf默认url为xxx\examples\images,因此您应该将img放入此url或set
发布于 2013-09-05 15:28:13
/**
* Deafult image logo used be the default Header() method.
* Please set here your own logo or an empty string to disable it.
*/
define ('PDF_HEADER_LOGO', '');在配置tcpdf.php文件中重写此代码
https://stackoverflow.com/questions/7214391
复制相似问题