2013-03-28 4 views
1

저는이 라이브러리 FPDF를 사용하여 매우 간단한 PDF를 작성했습니다. 이제 "결과 페이지"를 만들려고하는데이 이미지와 비슷한 것을 보여 주어야하지만, 모든 세포가 아닙니다.FPDF 경계선

a border must surround all the variables

, 이미 FPDF에서, 세포가 (이 그 일을 위해 최선의 방법인지 모른다) 것 만든 것을 얻고, 코드는 내가 손으로 결과를 추가 한 순간 (이렇게되면

//SimpleTable 
function SimpleTable() { 
    $this->Cell(280,15,"Inscription Number: 1",0); 
    $this->Cell(265,15,"Date: 28/03/2008",0); 
    $this->Ln(); 
    $this->Cell(265,15,"Name and Surname: Name Surname ",0); 
    $this->Cell(265,15,"",0); 
    $this->Ln(); 
    $this->Cell(280,15,"Address: Address",0); 
    $this->Cell(265,15,"",0); 
    $this->Ln(); 
    $this->Cell(280,15,"Zip Code: Zip Code",0); 
    $this->Cell(280,15,"City: City",0); 
    $this->Ln(); 
    $this->Cell(280,15,"Year of birth: Birthday",0); 
    $this->Cell(280,15,"Age: Age",0); 
    $this->Ln(); 
    $this->Cell(280,15,"VIP: No - First Time: Yes",0); 
    $this->Cell(280,15,"School: My school",0); 
} 

내가 그것을 할 수 beign 아니에요, 당신은 내가 한 모든 thouse 결과를 국경하는 방법에 도움이 될 수 있습니다 희망, 아무것도 찾을 수 없습니다 : 그냥)처럼 보이게하는 방법을 알아낼 수 있습니다.

항상 감사드립니다.

답변

0

시간 내 주셔서 감사합니다.하지만 드디어 방법을 찾았습니다. 셀의 테두리 옵션에서 "LT", "RT"를 추가했습니다 ... 모든 것을 둘러싸는 경계선을 만들 수있었습니다 (만드는 가장 좋은 방법은 아닐 수도 있습니다. , 나는 그것을 감사 할 것이다).

희망은 다른 사람들이 같은 것을 원할 수 있기를 바랍니다.

0

테두리가있는 빈 셀을 먼저 그려야합니다. 그런 다음 Y 위치를 저장하고 PDF 위치를 다시 설정하고 테두리 셀 내에 셀을 그리기 시작할 수 있습니다. 이처럼 :

//The BorderBox 
$actual_position_y = $pdf->GetY(); 
$pdf->SetFillColor(255, 255, 255); 
$pdf->SetDrawColor(0, 0, 0); 
$pdf->Cell($your_content_width, $your_content_heigth, "", 1, 1, 'C'); 

//Your actual content 
$pdf->SetXY($yourLeftosition, $actual_position_y); 
$pdf->Cell($cellwidth, $cellheigth, "Inscription Number", 0, 1, 'C'); 
... 

희망이 도움이 :)

2

당신은

Rect(StartX, StartY, Width, Height, Options) 

옵션

  • D 사용할 수 있습니다 -
  • F 라인
  • 그리기 - 기입
  • DF 또는 FD는 - 라인을 그리고 국경을 제공하거나 링크 here을 확인해야하는 경우 상자를 만들 FPDF의

$pdf->Rect(0, 0, 210, 100, 'D');

0
//The BorderBox 
$actual_position_y = $pdf->GetY(); 
$pdf->SetFillColor(255, 255, 255); 
$pdf->SetDrawColor(0, 0, 0); 
$pdf->Cell($your_content_width, $your_content_heigth, "", 1, 1, 'C'); 

//Your actual content 
$pdf->SetXY($yourLeftosition, $actual_position_y); 
$pdf->Cell($cellwidth, $cellheigth, "Inscription Number", 0, 1, 'C'); 
0

사용 FancyRow 플러그인을 채우기 당신을 도움이 될 수 있습니다 . 여기에서 사용할 수있는 또 다른 플러그인은 다중 셀이있는 테이블입니다. link을 확인하십시오.