在这段代码中,我不想在生成pdf时修剪单元格之间的空间
请问谁能帮我去掉一行中两个单元格之间的空白?图片必须显示在左边,标题必须显示在页面的中心在这段代码中,我不想在生成pdf时修剪单元格之间的空间,pdf,Pdf,请问谁能帮我去掉一行中两个单元格之间的空白?图片必须显示在左边,标题必须显示在页面的中心 PdfPTable table = new PdfPTable(2); table.setWidthPercentage(100); float[] columnWidths = {2.5f, 1.8f}; table.setWidths(columnWidths); Image image1 = Image.getInstance("C:\\Users\\MAHE
PdfPTable table = new PdfPTable(2);
table.setWidthPercentage(100);
float[] columnWidths = {2.5f, 1.8f};
table.setWidths(columnWidths);
Image image1 = Image.getInstance("C:\\Users\\MAHESH\\Desktop\\logo.png");
image1.scalePercent(40f);
PdfPCell cell11 = new PdfPCell(image1);
cell11.setPadding(padding);
cell11.setHorizontalAlignment(Element.ALIGN_LEFT);
cell11.setVerticalAlignment(Element.ALIGN_TOP);
cell11.setBorderWidthLeft(borderWidth);
cell11.setBorderWidthRight(borderWidthZero);
cell11.setBorderWidthTop(borderWidth);
cell11.setBorderWidthBottom(borderWidthZero);
table.addCell(cell11);
Phrase phrase0=new Phrase();
phrase0.add(title1);
PdfPCell cell1=new PdfPCell(phrase0);
cell1.setPadding(padding);
cell1.setColspan(4);
cell1.setHorizontalAlignment(Element.ALIGN_LEFT);
cell1.setVerticalAlignment(Element.ALIGN_BOTTOM);
cell1.setBorderWidthLeft(borderWidthZero);
cell1.setBorderWidthRight(borderWidth);
cell1.setBorderWidthTop(borderWidth);
cell1.setBorderWidthBottom(borderWidthZero);
table.addCell(cell1);
坚持你想修剪空间还是不想修剪?你的头衔说明了一件事,你的描述说明了另一件事。另外,提供一个屏幕截图也很有用,我们无法想象这是什么样子。我能知道如何附加屏幕截图上传到图像主机并提供链接吗。