Re: JpGraph and PDF



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

.



Relevant Pages

  • Re: JpGraph and PDF
    ... graphs in a pdf file, ... I use PHP 4..... ... the extension to png) and from Virtual Directory tab in Internet ...
    (comp.lang.php)
  • beamer slides: brightness changes with acroread
    ... Lots of graphs, most prepared using Tikz - some in-line, some ... after about 10 slides, I get a `random' change ... slides which include an external .pdf graphic (generated using tikz). ... pdf file generates as a stand-alone tikz graph. ...
    (comp.text.tex)
  • JpGraph and PDF
    ... graphs in a pdf file, ... CGI Error ... set of HTTP headers. ...
    (comp.lang.php)
  • Re: Creative Common Licence
    ... I ran the test on a .doc Shauna and it stayed as such. ... Plus the fact that the logo could be erased and the .doc changed inspite of ... My basic understanding of the CC license, ... become like a .pdf file and the copyright logo unerasable. ...
    (microsoft.public.word.docmanagement)
  • Re: Creative Common Licence
    ... When you pass the mouse over the logo, you do get instructions to press CTRL ... Dave Neve ... My basic understanding of the CC license, ... become like a .pdf file and the copyright logo unerasable. ...
    (microsoft.public.word.docmanagement)