2013-08-27 30 views
0

您好朋友我正在使用FPDF PHP庫來生成PDF。但是當我使用圖像方法和圖像源作爲遠程圖像時,它不會顯示任何內容。我在做什麼錯了,請幫助.. 例如fdpf遠程圖像不能正常工作

<? 
$this->pdf->Image('http://all-pic.com/wp-content/uploads/fefad025f1bc8db580dcc7ce7a4b2f07.jpg',$this->pdf->GetX(),$this->pdf->GetY(),50,50); 
?> 


但是這工作得很好

<? 
$this->pdf->Image('localimage.jpg',$this->pdf->GetX(),$this->pdf->GetY(),50,50); 
?> 

我已經在我的PHP設置了allow_url_fopen安裝和。

+0

我懷疑FPDF庫實現的網絡透明'圖片()'方法。你從哪裏得到這個想法? – arkascha

回答

0

複製遠程圖像到服務器,然後使用局部圖像中FPDF:

<?php 
copy('http://example.com/remoteimage.jpg', '/tmp/localimage.jpg'); 

$this->pdf->Image('/tmp/localimage.jpg',$this->pdf->GetX(),$this->pdf->GetY(),50,50); 
?>