views:

190

answers:

4

Hi,

Im trying to load a remote image into a pdf generated by tcpdf however I can't seem to get it to work?

The rest of the pdf loads fine and it looks like to trying to retrieve the image however it just does print to the page?

The code I am using is:

$pdf->Image("http://media.domain.com/logo.jpg", 0, 0, 100, 150, 'JPEG', '', 'T', true, 72,'','','','','','','');

Any help on this would be a massive help,

Thanks,

A: 

I never had any luck with remote images. I had to use a physical file path.

JasonMichael
A: 

I think you need to set

allow_url_fopen = On

in php.ini

It works for me

$pdf->Image('http://chart.apis.google.com/chart?cht=ls&chd=t:1366,1459,2534,2551,2589&chco=76A4FB&chls=2.0,0.0,0.0&chxt=x&chxl=0:|19|20|21|22|23&chs=600x150&chds=1366,2589', '', '', 100);
Beono
A: 

This problem has been completely addressed on the latest TCPDF release. Just uprgade. Check the TCPDF website at http://www.tcpdf.org and consult the official forum for further information.

A: 

Ended up using fpdf, but thanks for your suggestions.

Leonard Austin