WhatsApp us

How to generate dynamic Certificate in PHP using FPDF

  • Tech Area
  • Last updated on: January 8, 2026



In this tutorial, we discuss how to generate dynamic certificate in PHP. To generate dynamic certificate you have to download FPDF. FPDF is a PHP class which allows to generate PDF files with pure PHP, that is to say without using the PDFlib library.

Below are the step by step process of how to generate certificate in PHP using FPDF.

Step 1: Click on below link to download FPDF

http://www.fpdf.org/

Step 2: Design a certificate in .jpg/.jpeg format

Step 3: Download any suitable font file for certificate

In this step, download ‘Calibri_Regular’ font file.

Step 4: Create a folder to store dynamically generated certificate

In this step, create folder name ‘download-certificate’ to store dynamically generated certificate.

Step 5: Create index.php

In this step, create a new file index.php. This is the main file used to generate certificate.

index.php

<?php
require("fpdf/fpdf.php");
header('content-type:image/jpeg');
$font = "E:/xampp/htdocs/ecertificate/Calibri_Regular.ttf";
$time = time();

$image = imagecreatefromjpeg("Certificate.jpg");
$color = imagecolorallocate($image,19,21,22);
$name = "oliver sam";
imagettftext($image,90,0,690,800,$color,$font,$name);
                    //(size,angel,left-right,up-down)
imagejpeg($image,"download-certificate/$time.jpg");
imagedestroy($image);

$pdf = new FPDF();
$pdf->AddPage();
$pdf->Image("download-certificate/$time.jpg",0,0,210,148);
ob_end_clean();
$pdf->Output();
?>

After successfully follow all the step, you will find like this.

Step 6: Run the Program

Run the program using the URL: http://localhost/ecertificate/


Subscribe us via Email

Join 20,000+ subscriber

Subscribe on YouTube

PHP Projects
Matrimonial Portal Project in PHP & MySQL Last Updated: December 22, 2025
Event Management System Project in PHP & MySQL Last Updated: December 6, 2025
Online Shopping System Project in PHP MySQL Last Updated: November 26, 2025
Hostel management system project in PHP and MySQL Last Updated: February 14, 2024
Online Pizza Delivery project in PHP Last Updated: February 4, 2024
Parking Management System project in PHP Last Updated: November 5, 2023
Visitors Management System project in PHP Last Updated: August 28, 2023
SNIPE – IT Asset management system v6.1.0 Last Updated: April 21, 2023
Employee Management System project in PHP Last Updated: January 21, 2023