Browse Source

REPORT-22637 PDF导出时列宽有问题(以第一行为准,而不是每列的最大值为准)、解决验收问题

release/10.0
Hugh.C 5 years ago
parent
commit
2781b67b84
  1. 3
      fine-itext/src/com/fr/third/v2/lowagie/text/html/simpleparser/IncTable.java

3
fine-itext/src/com/fr/third/v2/lowagie/text/html/simpleparser/IncTable.java

@ -171,10 +171,11 @@ public class IncTable {
ArrayList cols = (ArrayList) rows.get(rowIndex); ArrayList cols = (ArrayList) rows.get(rowIndex);
for (int colIndex = 0; colIndex < cols.size(); colIndex++) { for (int colIndex = 0; colIndex < cols.size(); colIndex++) {
PdfPCell pCell = ((PdfPCell) cols.get(colIndex)); PdfPCell pCell = ((PdfPCell) cols.get(colIndex));
int cellCols = pCell.getColspan(); int cellCols = pCell.getColspan();
float avgWidth = pCell.getStyleWidth() / cellCols; float avgWidth = pCell.getStyleWidth() / cellCols;
for (int i = 0; i < cellCols && colIndex + i < colCount; i++) { for (int i = 0; i < cellCols && colIndex + i < colCount; i++) {
if (relativeColWidths.get(i) < avgWidth) { if (relativeColWidths.get(colIndex + i) < avgWidth) {
relativeColWidths.set(colIndex + i, avgWidth); relativeColWidths.set(colIndex + i, avgWidth);
} }
} }

Loading…
Cancel
Save