0
我使用iText創建表格。每張桌子有2列,除了桌子的最左邊,最右邊,最上面和最底面以外沒有邊界。我能夠實現這一點,但是當新頁面開始時會出現問題。我希望在頁面的末尾繪製水平線,並在開始時繪製另一條水平線。我已用在iText的頁面底部繪製一條水平線?
@Override
public void onEndPage(PdfWriter arg0, Document arg1) {
PdfPCell pdfpcells[] = pdfptable.getRow(pdfptable.getRows().size()-1).getCells();
pdfpcells[0].setBorderWidthBottom(0.5f);
if(pdfpcells[1] != null){ //There is a possibility that there are odd number of elements
pdfpcells[1].setBorderWidthBottom(0.5f);
}
}
繪製水平線在假設這功能頁的端部被稱爲每次頁端嘗試,並因此使用的行當前數目。 pdfptable被聲明爲類變量。這似乎並不奏效。我正在使用最新版本的iText。 謝謝。
retagged: - jsf + java – pakore 2010-07-15 10:03:04