1

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,

2 Answers2

2

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);

Update:

However, consider this recommendations regarding allow_url_fopen: Should I allow 'allow_url_fopen' in PHP?

Eldar Rakhimberdin
  • 1,042
  • 1
  • 7
  • 10
0

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.

user412934
  • 364
  • 4
  • 5