Set Font in PDF

Set Font in PDF


Posted in : PHP Posted on : January 19, 2011 at 6:03 PM Comments : [ 0 ]

This section contains the detail about the Set Font in PDF.

Set Font in PDF

In this tutorial you will learn how to set font  in PDF in a PHP web application .  The code of  "set-font.php" given below :

<?php
require('fpdf16/fpdf.php');

$pdf=new FPDF();
$pdf->AddPage();
$pdf->SetFont('Times','I',16);
$pdf->Cell(0,10,'Set Font in PDF',0,0,'C');
$pdf->ln();
$pdf->SetFont('Times','I',10);
$pdf->Cell(0,10,'Set Font again in PDF',0,0,'C');

$pdf->Output();
?>

In the 'pdffile.php' file :

  • "$pdf->SetFont('Times','I',16);"  and " $pdf->SetFont('Times','I',10); "  set font in PDF.

Output :

When run "set-font.php" display  as :

Download Source Code

Go to Topic «PreviousHomeNext»

Your Comment:


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 

 
Tutorial Topics