<?php

        try{

        #GET LIBRARY
        require('fpdf.php');
        #GET LIBRARY

        $pdf     = new Fpdf();
        header('content-type:image/jpeg');


                $source               = $_SERVER['DOCUMENT_ROOT']."/assets/online/paid.jpg";

                $image                = imagecreatefromjpeg($source);

                $font                 = $_SERVER['DOCUMENT_ROOT']."/assets/online/font/OpenSans-Regular.ttf";
                $color                = imagecolorallocate($image,0,0,0);

                imagettftext($image,25,0,350,300,$color,$font,$order_id);
                imagettftext($image,25,0,750,300,$color,$font,$date);
                imagettftext($image,25,0,350,360,$color,$font,$name);
                imagettftext($image,25,0,350,420,$color,$font,$email);
                imagettftext($image,25,0,350,480,$color,$font,$phone);
                imagettftext($image,25,0,350,540,$color,$font,$amount." LKR");

                imagejpeg($image,$_SERVER['DOCUMENT_ROOT'].'/assets/online/update/paid.jpg', 50);

                $pdf->AddPage();
                $pdf->Image($_SERVER['DOCUMENT_ROOT'].'/assets/online/update/paid.jpg',10,10,189);

        $pdf->Output();
        exit;


        }
        catch(Exception $e)
        {
            echo $e;
        }



?>
