Layout 使用tcpdf在页面最右侧显示PDF_标题_徽标

Layout 使用tcpdf在页面最右侧显示PDF_标题_徽标,layout,tcpdf,Layout,Tcpdf,我正在尝试使用TCPDF创建pdf报告卡 是否可以在页面最右侧显示PDF_HEADER_徽标,在页面左侧显示PDF_HEADER_TITLE和PDF_HEADER_字符串 以下是我的代码: $pdf->SetHeaderData( PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, 'Report Card', $val['Student']['name'] ); 通过扩展tcpdf类,我成功地将徽标显示在页面的最右侧,并将标题和标题字符串显示

我正在尝试使用TCPDF创建pdf报告卡

是否可以在页面最右侧显示PDF_HEADER_徽标,在页面左侧显示PDF_HEADER_TITLE和PDF_HEADER_字符串

以下是我的代码:

$pdf->SetHeaderData(
  PDF_HEADER_LOGO,
  PDF_HEADER_LOGO_WIDTH,
  'Report Card',
  $val['Student']['name']
);

通过扩展tcpdf类,我成功地将徽标显示在页面的最右侧,并将标题和标题字符串显示在左侧,如中所述。我还提到

以下是我的

 <?php 
App::import('Vendor','tcpdf/tcpdf'); 

class XTCPDF  extends TCPDF 
{ 

var $xheadertext  = 'PDF created using CakePHP and TCPDF'; 
var $xheaderstring = 'headerstring';
var $xheadercolor = array(0,0,200); 
var $xfootertext  = 'Copyright © %d XXXXXXXXXXX. All rights reserved.'; 
var $xfooterfont  = PDF_FONT_NAME_MAIN ; 
var $xfooterfontsize = 8 ; 
//var $xheaderlogo = PDF_HEADER_LOGO;


/** 
* Overwrites the default header 
* set the text in the view using 
*    $fpdf->xheadertext = 'YOUR ORGANIZATION'; 
* set the fill color in the view using 
*    $fpdf->xheadercolor = array(0,0,100); (r, g, b) 
* set the font in the view using 
*    $fpdf->setHeaderFont(array('YourFont','',fontsize)); 
*/ 
function Header() 
{ 

    list($r, $b, $g) = $this->xheadercolor; 
    $this->setY(10); // shouldn't be needed due to page margin, but helas, otherwise it's at the page top
     $this->SetFillColor($r, $b, $g); 
    $this->SetTextColor(0 , 0, 0); 
    $this->Text(15,15,$this->xheadertext); 
    $this->Text(30,15,$this->xheaderstring); 
    $image_file = K_PATH_IMAGES.'logo.jpg'; 
    $this->Image($image_file, 160, 10, 40, '', 'JPG', '', 'T', false, 20, '', false, false, 0, false, false, false); 
   $this->SetFont('helvetica', 'B', 10); 

} 
多谢各位