我把我的出版商核心从它-2.致itextpdf-5.5.6
在itext 2中,我将一个图像放入一个PdfPTable的单元格中,而我的桌子的单元格有相同大小的图像。现在,在itextpdf-5.5.6图像中,像那个单元格一样大小很小。
例如,我使用
table.setTotalWidth(450);在核心itextpdf中,它也计算高度:
//ITEXTPDF
calculateWidths();
calculateHeights();calculateHeight对getRowHeight的调用
getRowHeight(k, true);它不像在itext 2中做的那样:
我删除了itextpdf,并发现在pdfLine.getMaxSize(.)有以下代码:
if (chunk.isImage()) {
Image img = chunk.getImage();
if (chunk.changeLeading()) {
float height = chunk.getImageHeight() + chunk.getImageOffsetY() + img.getSpacingBefore();
image_leading = Math.max(height, image_leading);
}
}对于itext,我没有这样的条件:
if (chunk.changeLeading()){......}有平均值来解决这个问题吗?
发布于 2015-09-30 10:03:24
我发现哪里有问题:
Paragraph para = new Paragraph(new Chunk((Image) element, 0, 0, Boolean.FALSE));块的最后一个参数是changeLeading,它只需更改为Boolean.TRUE。
谢谢大家的答复
https://stackoverflow.com/questions/32848110
复制相似问题