|
Posted by iulian.ilea on 09/20/06 09:40
iulian.ilea wrote:
> Hi,
>
> 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');
> //Output it (requires PHP>=4.3.2 and FPDF>=1.52)
> $pdf->Image('var://logo', 0, 0, 150, 0, 'PNG');
> ___
>
> ...to include genereted graph i get this error:
> ___
> CGI Error
> The specified CGI application misbehaved by not returning a complete
> set of HTTP headers. The headers it did return are:
> ___
>
> So, I need to save generated graph into a file and then to include in
> pdf using
> ___
> $logo=file_get_contents('splineex1.png');
> //Output it (requires PHP>=4.3.2 and FPDF>=1.52)
> $pdf->Image('var://logo', 0, 0, 150, 0, 'PNG');
> ___
>
> The problem is that I can't find how to save it.
>
> http://www.fpdf.org/
> http://www.aditus.nu/jpgraph/
>
> I use PHP 4.....
I made it work using a trick, but I hope I'll find another solution. If
you have any ideaa... post it.
trick:
I use IIS. I created one virtual directory with a name... example (in
my cased). After, I renamed the php script in scriptphp.png (i changed
the extension to png) and from Virtual Directory tab in Internet
Information Server, click Configuration, add new extension - png - and
set it to be executed by php.
Now, if I use:
___
$pdf->Image("http://localhost/examples/scriptphp.png", 0, 0, 150, 0,
'PNG');
___
....it works.
I tried with curl too, but is not working. Or I can't make it work.
[Back to original message]
|