PHP FPDF 仅在特定情况下更改字体大小

PHP FPDF changing font size in specific are only

我已经将所有 pdf 的字体大小设置为 10,问题是如果我想更改 pdf 特定区域的字体大小而不更改所有字体大小,可以吗?看下面的代码,我想改变这些区域的字体大小 $pdf->SetXY(17, 80) ;

 <?php

 require_once('../../bus_partners/fpdf/fpdf/fpdf.php');
 require_once('../../bus_partners/fpdf/fpdi/fpdi.php');

 $pageCount   =  $pdf->setSourceFile('../../bus_partners/BIR-forms/2316.pdf') ;
 $tplIdx      =  $pdf->importPage(1, '/MediaBox');
                     
 $pdf->SetAutoPageBreak(false) ;
 $pdf->addPage('P', 'Legal') ;
 $pdf->useTemplate($tplIdx, 8, 12, 200, 320) ;


 // setting the font size for the whole page
 $pdf->SetFont('Arial');
 $pdf->SetFontSize(9);
 $pdf->SetTextColor(12, 12, 12);


 // Can I set the font size in this specific area only ?
 $pdf->SetXY(17, 80) ;
 $pdf->Write(0, $address_ee) ;



 ?>




 

就这样吧:

<?php
...
  $pdf->SetFont('Arial', 'B', 14);
  $pdf->SetXY(17, 80) ;
  $pdf->Write(0, $address_ee) ;
...
?>

你可以在这里看到setFont的设置: http://www.fpdf.org/en/doc/setfont.htm