You are here: Re: JpGraph and PDF « PHP Programming Language « IT news, forums, messages
Re: JpGraph and PDF

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация