TCPDF remote image loading problem

女生的网名这么多〃 提交于 2019-12-02 16:03:02

问题


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,


回答1:


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



回答2:


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.



来源:https://stackoverflow.com/questions/2687352/tcpdf-remote-image-loading-problem

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!