Java iText操作PDF文档(四)

2014-11-24 03:29:11 · 作者: · 浏览: 5
);
proinfoTab.addCell(proinfoCell);

proinfoCell = new Cell(new Paragraph("单位名称", ST2));
proinfoCell.setUseAscender(true);
proinfoCell.setVerticalAlignment(Cell.ALIGN_MIDDLE);
proinfoCell.setHorizontalAlignment(Cell.ALIGN_CENTER);
proinfoTab.addCell(proinfoCell);

proinfoCell = new Cell(new Paragraph("基地类别", ST2));
proinfoCell.setUseAscender(true);
proinfoCell.setVerticalAlignment(Cell.ALIGN_MIDDLE);
proinfoCell.setHorizontalAlignment(Cell.ALIGN_CENTER);
proinfoTab.addCell(proinfoCell);

proinfoCell = new Cell(new Paragraph("分值", ST2));
proinfoCell.setUseAscender(true);
proinfoCell.setVerticalAlignment(Cell.ALIGN_MIDDLE);
proinfoCell.setHorizontalAlignment(Cell.ALIGN_CENTER);
proinfoTab.addCell(proinfoCell);

proinfoCell = new Cell(new Paragraph("等级", ST2));
proinfoCell.setUseAscender(true);
proinfoCell.setVerticalAlignment(Cell.ALIGN_MIDDLE);
proinfoCell.setHorizontalAlignment(Cell.ALIGN_CENTER);
proinfoTab.addCell(proinfoCell);

proinfoCell = new Cell(new Paragraph("专家评语", ST2));
proinfoCell.setUseAscender(true);
proinfoCell.setVerticalAlignment(Cell.ALIGN_MIDDLE);
proinfoCell.setHorizontalAlignment(Cell.ALIGN_CENTER);
proinfoTab.addCell(proinfoCell);

if (importList.size() > 0 && importList != null) {
for (int i = 0; i < importList.size(); i++) {

BBasePoint bbp = (BBasePoint) importList.get(i);
BBaseDocument doc = bbp.getBBaseDocument();

// 序号
proinfoCell = new Cell(new Paragraph(String.valueOf(i + 1),
ST));
proinfoCell.setUseAscender(true);
proinfoCell.setVerticalAlignment(Cell.ALIGN_MIDDLE);
proinfoCell.setHorizontalAlignment(Cell.ALIGN_CENTER);
proinfoTab.addCell(proinfoCell);

// 区县
if (doc.getDocCorpSection() == null) {
proinfoCell = new Cell(new Paragraph("无", ST));
} else {
proinfoCell = new Cell(new Paragraph(doc
.getDocCorpSection(), ST));
}
proinfoCell.setUseAscender(true);
proinfoCell.setVerticalAlignment(Cell.ALIGN_MIDDLE);
proinfoCell.setHorizontalAlignment(Cell.ALIGN_CENTER);
proinfoTab.addCell(proinfoCell);

// 基地名称
if (doc.getBaseName() == null) {
proinfoCell = new Cell(new Paragraph("无", ST));
} else {
proinfoCell = new Cell(new Paragraph(doc.getBaseName(),
ST));
}
proinfoCell.setUseAscender(true);
proinfoCell.setVerticalAlignment(Cell.ALIGN_M