我已将所有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) ;
?>发布于 2021-01-31 00:50:19
就像这样做:
<?php
...
$pdf->SetFont('Arial', 'B', 14);
$pdf->SetXY(17, 80) ;
$pdf->Write(0, $address_ee) ;
...
?>您可以在此处查看setFont的设置:http://www.fpdf.org/en/doc/setfont.htm
https://stackoverflow.com/questions/65968701
复制相似问题