Edgar
Edgar

Reputation: 1131

FPDF error: Can't open image file: http://chart.apis.google.com/char

I am using googlechartphplib to generate my charts. They are generated as images. Heres an example of one image - Click Here. I store this url as $pie_chart1_url.

I am trying to make a pdf file, and i want to put this image inside this pdf. I am using fpdf class for this. I dont understand why am i having this problem:

$pdf->Image($pie_chart1_url, 0, 40, 0, 0, 'png');

Getting this error:

FPDF error: Can't open image file: http://chart.apis.google.com/chart....` error.

If i write it manually:

$pdf->Image('http://chart.apis.google.com/chart?cht=pc&chs=200x200&chtt=Svetain%C4%97+veik%C4%97%3F&chd=t%3A50.00%2C40.00&chco=25C114%2CC11425&chl=50%7C40&chdl=Taip%7CNe&chdlp=bs', 0, 40, 0, 0, 'png');

It works without any errors..

Upvotes: 1

Views: 12816

Answers (1)

Pierre de LESPINAY
Pierre de LESPINAY

Reputation: 46178

You must have the directive allow_url_open activated

Upvotes: 2

Related Questions