2016-12-12 2 views
0

송장 인쇄물을 작성 중입니다.TCPDF 설명서 페이지 나누기

송장 인쇄시 문제가 있습니다. 정확히 1 페이지에있는 항목으로 구성된 인보이스가 있다고 가정 해 보겠습니다. 문제는 모든 품목 다음에 소계, 세금 및 총액이 있다는 것입니다.

이 경우이 항목은 첫 번째 페이지에 있지만 두 번째 페이지 (새 페이지)에 있습니다.

한 페이지가 tcpdf에서 보관할 수있는 행 (모든 레이아웃 형식 등)을 확인한 결과 1 페이지는 28 개 항목으로 구성됩니다. 모든 항목이 1 행으로 구성된 경우이 작업이 잘 수행됩니다. 그러나 항목 중 일부가 2 개 이상의 행으로 구성된 경우 계산에 문제가 발생하며 전체 구조가 엉망이됩니다.

총 항목이 28 개 항목 인 경우 자동으로 일부 항목을 두 번째 페이지로 이동시킬 수 있으므로 두 번째 페이지는 부분합, 세금 및 총계로 구성되지 않을 수 있습니까?

여기 내 코드

$count = 0; 
$i = 0; 
if(count($finalProduct)>0){ 
foreach($finalProduct as $product){ 
    foreach($product['product'] as $prod){ 
     if($prod['qty'] > 0){ 

      /* check the row */ 
      if($count >= 27){ 
       $PDFCONTENT .= '<tr style="page-break-after:initial"><td colspan="6"></td></tr>'; 
       $PDFCONTENT .= '<tr><td colspan="6"></td></tr>'; 
       $count = 0; 
      } 

       $PDFCONTENT .= ' 
        <tr nobr="true">'; 
       $PDFCONTENT .= '<td align="center" width="7%">'.$prod['index_number'].'</td>'; 
           </tr>'; 
      } 
      $count++; 
     } 
     $PDFCONTENT .= '<tr><td></td></tr>'; 
    } 
    } 
    $PDFCONTENT .= '<tfoot> 
    <tr> <td> </td> </tr> 
    <tr> 
    <th align="right" colspan="6">SUB TOTAL $:-</th> 
    <th style="border-top: 1px solid black;border-bottom: 1px solid black;" align="center">'.number_format($data['total'],2).'</th> 
</tr> 
    <tr> 
    <th align="right" colspan="6">ADD '.number_format($data['transaction_tax_percentage']).'% $:-</th> 
    <th style="border-top: 1px solid black;border-bottom: 1px solid black;" align="center">'.number_format($data['transaction_tax_amount'],2).'</th> 
</tr> 
    <tr> 
    <th align="right" colspan="6">TOTAL $:-</th> 
    <th style="border-top: 1px solid black;border-bottom: 1px solid black;" align="center">'.number_format($data['grand_total'],2).'</th> 
</tr> 
</tfoot>'; 

답변

0

나는이 테이블 진짜 문제라고 기억합니다. 그래서 우리는 설정 될 페이지가 있다면 계산할 것입니다. 그렇다면 테이블을 닫고 새 사이트를 추가 한 다음 테이블을 다시 열고 나머지 테이블을 테이블에 넣습니다. 당신이 다른 문제로 연결 테이블을 닫습니다하지 않는 경우

우리가 <br pagebreak="true"/>

을 사용하는 페이지 나눔을 강제로.

여기도 좋은 위협이 있습니다. Manual Page Break in TCPDF