2010-07-10 5 views
0

다음과 같이 보이길 원합니다. 그 다음 각 테이블에 바코드를 넣을 계획입니다. 어떤 도움을 주셔서 감사합니다.itextsharp 페이지에서 2 열 테이블로 3 열 생성

_________ ________ ______ 
|  | |  | |  | 
|  | |  | |  | 
|  | |  | |  | 
|  | |  | |  | 
--------- -------- -------- 
_________ ________ ______ 
|  | |  | |  | 
|  | |  | |  | 
|  | |  | |  | 
|  | |  | |  | 
--------- -------- -------- 

답변

0

희망 도움이 다음 코드 ...

Document document = new Document(rect, marginLeft, marginRight, marginTop, marginBottom); 

int tableColumns = 3; 
Table aTable = new Table(tableColumns); 
int row = 1; 
int col = 0; 
foreach (Barcode s in codeslist) 
{ 
    // Create new barcode 
    Image imageCode128 = GetImageCode128(s); 

    // Create a new cell to host the barcode image 
    Cell cell = new Cell(); 
    cell.Add(imageCode128); 
    aTable.AddCell(cell,row,col); 
    if (col == tableColumns-1) 
    { 
     col = 0; 
     row ++; 
    } 
    else col++; 
} 

// Add the completed table to the Document and close it. 
document.Add(aTable); 

document.Close();