Search code examples
symbolsfpdf

how to setFont Arial and symbol on 1 cell in FPDF


So, if I want to use a symbol, but there is a word behind the symbol, what should I do? I wanted a look like this

Σsum

, and this is what I've been trying to do ,,,

$this->SetFont('Arial','B',7);
$this->SetX(10);
$this->Cell(5,10,'NO.',1,0,'C',1);
$this->SetFont('Symbol','B',7);
$this->SetX(15);
$this->Cell(15,10,"SUM".chr(83),1,0,'C',1);

Solution

  • This code display what you're looking for. (Note $pdf instead of $this)

    $pdf->SetXY(10,10);
    $pdf->SetFont('Symbol','B',7);
    $pdf->Cell(10,10,'S',0,'','C');
    $pdf->SetFont('Arial','B',7);
    $pdf->Cell(-3,10,'sum',0,'','C');