2017-11-14 6 views
0

인보이스 응용 프로그램을 만들고 fpdf 및 https://github.com/farjadtahir/pdf-invoicr pdf-invoicr 클래스를 사용하고 있습니다. 그 잘 작동하지만 지금은 주소와 같은 데이터베이스에 멀티 라인 내용이, 내가 양식에서 텍스트 영역의 컨텐츠를 저장하고 때, BR 태그로 저장됩니다이 세포 속성을 FPDF로 전달셀의 여러 줄 내용 fpdf

nl2br(htmlentities($address, ENT_QUOTES, 'UTF-8')); 

그 br 태그로 표시하면, 나는 사용한다.

str_ireplace('<br />', "\r\n", $address); 

br를 공백으로 바꾸는 것만으로 새 줄에 표시하지 않은 후에도. 세포

foreach($this->items as $item) 
      { 

       $cHeight = $cellHeight; 
       $this->SetFont($this->font,'b',8); 
       $this->SetTextColor(50,50,50); 

       $cbgcolor = explode(",",$item['cbgcolor']); 

       $this->SetFillColor($cbgcolor[0],$cbgcolor[1],$cbgcolor[2]); 
       $this->Cell(1,$cHeight,'',0,0,'L',1); 
       $x = $this->GetX(); 
       $this->Cell($this->firstColumnWidth,$cHeight,iconv("UTF-8", "ISO-8859-1",$item['item']),0,0,'L',1); 

       $this->SetTextColor(50,50,50); 
       $this->SetFont($this->font,'',8); 
       $this->Cell($this->columnSpacing,$cHeight,'',0,0,'L',0); 
       $this->Cell($this->secondColumnWidth,$cHeight,$item['quantity'],0,0,'L',1); 

       $this->Cell($this->columnSpacing,$cHeight,'',0,0,'L',0); 
       $this->Cell($this->priceColumnWidth,$cHeight,iconv('UTF-8', 'windows-1252', $this->currency.' '.number_format($item['price'],2,$this->referenceformat[0],$this->referenceformat[1])),0,0,'C',1); 

       $this->Cell($this->columnSpacing,$cHeight,'',0,0,'L',0); 
       $this->Cell($this->priceColumnWidth,$cHeight,iconv('UTF-8', 'windows-1252', $this->currency.' '.number_format($item['total'],2,$this->referenceformat[0],$this->referenceformat[1])),0,0,'C',1); 
       $this->Ln(); 
       $this->Ln($this->columnSpacing); 
      } 

내부에 멀티 라인의 값을 출력 할 수있는 방법이 있나요이 내 body..for $ 항목 [ '수량'] 멀티 라인 내용이입니다. 어디에 내가 table.so로 가치를 인쇄 오전 하나의 열에 multicell을 사용하면 레이아웃이 바뀌고 잘 보이지 않습니다.

+0

를 사용하여 셀에 텍스트를 포장 할 수 있습니다, 그래서 우리는 당신이 "세포"가 무슨 뜻인지 볼 수 있습니까? – IMSoP

답변

0

당신은 당신이 PDF로이 문자열을 추가하는 코드를 보여줄 수 MultiCell

$pdf->MultiCell(200, 40, $address, 1);