2011-11-14 2 views
2

MPDF에서 overflow : hidden을 사용하여 div를 올바르게 인쇄하려고합니다. 나는 그들의 문서를 위아래로 읽고 다양한 것을 시도했다. 불운. mpdf 단위로, 오버 플로우가있는 블록 요소 : 숨김은 절대 위치 또는 위치 : 고정 세트를 가져야합니다. 한 div 만 인쇄하면 괜찮습니다. 문제는 div를 중첩하고 텍스트를 클립하기 위해 내부 div를 필요로 할 때 발생합니다. 여기의 의미는 다음과 같습니다이 출력합니다MPDF 및 오버 플로우 관련 문제 : 중첩 된 div에서 숨김

벌금

$html = <<< EOM 
<div style='width:300px;height:100px;position:absolute;overflow:hidden;border:1px solid black;'> 
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. 
</div> 
$html = <<< EOM 

$html = <<< EOM 
<div style='border:1px solid red;position:relative;'> 
<div style='width:300px;height:100px;position:absolute;overflow:hidden;border:1px solid black;'> 
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. 
</div> 
</div> 
$html = <<< EOM 

유일한 차이점은 당신이 볼 수 있듯이 PHP 스크립트가

include("mpdf.php"); 
$mpdf=new mPDF(); 
$mpdf->WriteHTML($html); 
$mpdf->Output(); 

간단한되어 있지 이것은 않습니다

한 div는 다른 div 안에 있습니다. 아무도 이것을하는 방법을 알아 냈는가?

답변

0

mpdf에서는 중첩 된 div에 overflow: hidden;을 사용할 수 없습니다. overflow: hidden;은 최상위 수준 요소에서만 사용할 수 있습니다.

관련 문제