<?php 

header('Content-type: image/jpeg');

$image = 'bmg.jpg';

$image_info = getimagesize($image);
$center_width = $image_info[0] / 2;
//print_r($image_info);
//die();
$img = imagecreatefromjpeg($image);
$color = imagecolorallocate($img, 0,0,0);
$font = __DIR__."/Roboto/Roboto-Bold.ttf";

$name = strlen('Shekhar');
$final = $center_width - $name;
imagettftext($img, 25, 0, 330, 380, $color, $font, 'Shekhar');
imagettftext($img, 20, 0, 300, 420, $color, $font, 'This is first Address1');
imagettftext($img, 20, 0, 300, 460, $color, $font, 'Address2');

imagettftext($img, 20, 0, 350, 760, $color, $font, 'Scope');

$date = date('Y-m-d');
imagettftext($img, 12, 0, 232, 913, $color, $font, $date);

$date2= strtotime($date); 
$end = date('Y-m-d', strtotime('+3 years', $date2));
$end2= strtotime($end);
$end = date('Y-m-d', strtotime('-1 days', $end2));

imagettftext($img, 12, 0, 232, 935, $color, $font, $end);


imagejpeg($img);
//imagejpeg($img, 'img/'.$img);
imagedestroy($img);
?>


