Log in

View Full Version : gd library - text



sukanya.paul
11-23-2007, 02:16 AM
hi.. my problem is that i hv a form in which der are text fields like recipient name senders name and msg which are to be entered by user. after submitting this form, he text entered has to be printed to an image of a gift cert. i hv to do this using gd library. i could do it partly but am not able to align the text or give line breaks etc. can someone pls help.
its really really urgent..
thanks in advance..suk
ps-- i hv attached the cert how it should look after inserting the text..
my code

<?php
header("Content-type: image/gif");
$string = "This certificate entitles" ;
/*$string.=$_POST['r_name'];
$string. "Message from";
$string.=$_POST['y-mail'];
$string.$_POST['msg'];*/
$im = imagecreatefromgif("Images/sample-certificate.gif");
$orange = imagecolorallocate($im, 220, 210, 60);
$px = (imagesx($im) - 7.5 * strlen($string)) / 2;
imagestring($im, 3, $px, 9, $string, $orange);
imagegif($im);
imagedestroy($im);
?>

tech_support
11-23-2007, 06:22 AM
sry i don't noe wat u r talkin about. pls use english not "net spk". ty.

(Sorry, I don't know what you are talking about. Please use English not "internet talk". Thanks.)