|
Posted by NC on 09/20/06 14:24
iulian.ilea wrote:
>
> I use JpGraph to generate some graphs and I have to include those
> graphs in a pdf file, generated usign fPDF (http://www.fpdf.org/). If I
> include a png file it's ok, the pdf file is generated, everithing goes
> ok. If I use this code:
> ___
> $logo=file_get_contents('splineex1.php');
If you do this, $logo will contain your PHP code. To get the image,
you need to do:
$logo = file_get_contents('http://localhost/path/splineex1.php');
> So, I need to save generated graph into a file
You could, but you don't have to (see above). If you still want to
save the image into a file, you can do it inside splineex1.php by
specifying the target file name as a second argument to imagepng().
See imagepng() dicumentation:
http://www.php.net/imagepng
Alternatively, you could do:
$logo = file_get_contents('http://localhost/path/splineex1.php');
$fp = fopen('splineex1.png', 'w');
fwrite($fp, $logo);
fclose($fp);
Cheers,
NC
Navigation:
[Reply to this message]
|