2012-10-03 5 views
0

내 프로젝트 중 하나에서 PDF 파일을 생성하는 데 tcpdf을 사용하고 있는데 div의 테두리를 가져 오지 않았습니다. 그러나 동일한 레이아웃에서 테이블을 사용할 때 경계를 선택합니다.tcpdf가 div 테두리를 선택하지 않습니다.

내가 tcpdf에서 CSS에 대해해야 할 일을 제안 해주십시오.

또는

<div class="div_info" style="width:100%; float:left; padding:10px 0px;"> 
    <div style="padding:2px 0 0 0; margin:0px; float:left;"><p>Interior/Exterior BPO</p>'.$row->interior_exterior_form.'</div> 
    <div style="padding:2px 0 0 0; margin:0px; float:left;"><p>Property Address:</p>'.$row->property_address.'</div> 
    <div style="padding:3px 0 0 33px; margin:0px; float:left;"><p>Borrower(s):</p>'.$row->borrowers.'</div> 
    <div style="padding:3px 0 0 35px; margin:0px; float:left;"><p>Loan/REO#:</p>'.$row->loan_number.'</div> 
</div> 

그것은 단지 인라인 CSS를 지원하고있다 TCPDF의 CSS 파일을 포함하는 다른 방법은?

위의 레이아웃에서 테두리를 사용하면 픽업되지 않지만 테이블을 사용하면 테두리가 추가됩니다.

답변

0
$html = <<<EOF 
<style> 
    div.test { 
     color: #CC0000;  
     border-style: solid; 
     border-width: 1px; 
     border-color: #000; 
     text-align: center; 
    } 
</style> 

<div class="test">This is your div content.</div> 

<br /> 

EOF; 

// output the HTML content 
$pdf->writeHTML($html, true, false, true, false, ''); 

$pdf->lastPage(); 

$pdf->Output('sample.pdf', 'I'); 

자세한 내용은 this link을 방문하고 예제 # 61을 확인하십시오.

관련 문제