9951 explained code solutions for 126 technologies


php-tcpdfHow do I use the setfont function in PHP TCPDF?


The setFont function in PHP TCPDF is used to set the font type, style and size for the document.

Example

$pdf->SetFont('helvetica', 'B', 20);

The code above sets the font type to Helvetica, the style to bold, and the font size to 20.

Code explanation

  • SetFont: The name of the function.
  • helvetica: The font type.
  • B: The font style.
  • 20: The font size.

Helpful links

Edit this code on GitHub