2017-04-06 6 views
0

,이미지 (CodeIgniter를, TCPDF, PHP)의 크기 CodeIgniter의를 사용하여 TCPDF에 사진을 표시 할 때 나는 문제가

이 내 PDF보기입니다 가져올 수 없습니다 :

$base_url=base_url(); 

// NON-BREAKING ROWS (nobr="true") 

$tbleauproduct = <<<EOD 
<br /><br /><br /> 
<table border="1" align="center"> 
    <tr> 
     <th>picture</th> 
     <th>Product name</th> 
     <th>Price</th> 
     <th>Quantity</th> 
    </tr> 
    <tr> 
     <td><img src="$base_url/assets/$picture" /></td> 
     <td>$name</td> 
     <td>$price</td> 
     <td>$qty</td> 
    </tr> 
</table> 
EOD; 

$pdf->writeHTML($tbleauproduct, true, false, true, false, ''); 

TCPDF ERROR: [Image] Unable to get the size of the image: http://localhost:8888/open_bay//assets/130501153059-htc-one-1024x576.jpeg 
+0

PDF 이미지되지 않습니다 :이 결과입니다. – Narf

+0

가능한 [TCPDF 오류 : 이미지의 크기를 얻을 수 없음] (http://stackoverflow.com/questions/27060947/tcpdf-error-unable-to-get-the-size-of-the-image) –

+0

코드 이미지 게시를 피하십시오. 항상 코드를 텍스트로 게시하십시오. 나는 당신을 위해 당신의 이미지를 대체했습니다. – mickmackusa

답변

0
$file_path = base_url().'assets/130501153059-htc-one-1024x576.jpeg'; 
$size = filesize($file_path); 
+0

이 방법을 사용했지만이 문제가 발견되었습니다. 메시지 : filesize() : http : // localhost : 8888/open_bay/assets/130501153059-htc-one-1024x576.jpeg –

+1

코드 전용 답변은 다음과 같이 개선 할 수 있습니다. 설명을 제공하거나 공식 문서에 링크되어있을 수 있습니다. 대답은 OP가 문제를 해결하는 데 도움이되지 않으며, 미래 SO 연구자가 문제를 신속하게 해결할 수 있도록 도와줍니다. 모든 게시물을 가능한 한 최고 품질로 만들어라. 그리고 upvotes에서 더 많은 rep 지점을 얻기 위해 서게 될 것이다. – mickmackusa