明显表格线粗细不一致,求原因代码:
Document document = new Document();
try {
PdfWriter.getInstance(document, new FileOutputStream("C:\\添加标题1.pdf"));
document.open();
PdfPTable table2 = new PdfPTable(2);
String[] data1={"1","1","1","1","1","1","1","1","1"};
//String[] data2={"S13282","赵存礼"," "," "," "," "," "," "};
for(int i=0;i<data1.length;i++){
PdfPCell cell=new PdfPCell(new Paragraph(data1[i]));
//cell.setFixedHeight(25);
//cell.setHorizontalAlignment(Element.ALIGN_CENTER);
//cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
//cell.setBorderWidth(0.5f);
table2.addCell(cell);
} document.add(table2);
document.close();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Document document = new Document();
try {
PdfWriter.getInstance(document, new FileOutputStream("C:\\添加标题1.pdf"));
document.open();
PdfPTable table2 = new PdfPTable(2);
String[] data1={"1","1","1","1","1","1","1","1","1"};
//String[] data2={"S13282","赵存礼"," "," "," "," "," "," "};
for(int i=0;i<data1.length;i++){
PdfPCell cell=new PdfPCell(new Paragraph(data1[i]));
//cell.setFixedHeight(25);
//cell.setHorizontalAlignment(Element.ALIGN_CENTER);
//cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
//cell.setBorderWidth(0.5f);
table2.addCell(cell);
} document.add(table2);
document.close();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货