Re: JpGraph and PDF
- From: "NC" <nc@xxxxxxxxx>
- Date: 20 Sep 2006 07:24:38 -0700
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
.
- References:
- JpGraph and PDF
- From: iulian.ilea
- JpGraph and PDF
- Prev by Date: Re: Need to Flush before Sleep but I'm blank.
- Next by Date: Cookie problems (simple code included)
- Previous by thread: Re: JpGraph and PDF
- Next by thread: check syntax before include
- Index(es):
Relevant Pages
|