PdfPCell obtainCell(final int row, final int col) { PdfPCell[] cells = ((PdfPRow)rows.get(row)).getCells(); for (int i = 0; i < cells.length; i++) { if (cells[i] != null) { if (col >= i && col < (i + cells[i].getColspan())) { return cells[i]; } } } return null; } /**
/** * Gets the height of the rows that constitute the header as defined by * <CODE>setHeaderRows()</CODE>. * * @return the height of the rows that constitute the header and footer */ public float getHeaderHeight() { float total = 0; int size = Math.min(rows.size(), headerRows); for (int k = 0; k < size; ++k) { PdfPRow row = (PdfPRow)rows.get(k); if (row != null) total += row.getMaxHeights(); } return total; }
/** * Calculates the extra height needed in a row because of rowspans. * @param start the index of the start row (the one to adjust) * @param end the index of the end row on the page * @since 2.1.6 */ protected PdfPRow adjustCellsInRow(int start, int end) { PdfPRow row = new PdfPRow(getRow(start)); row.initExtraHeights(); PdfPCell cell; PdfPCell[] cells = row.getCells(); for (int i = 0; i < cells.length; i++) { cell = cells[i]; if (cell == null || cell.getRowspan() == 1) continue; int stop = Math.min(end, start + cell.getRowspan()); float extra = 0; for (int k = start + 1; k < stop; k++) { extra += getRowHeight(k); } row.setExtraHeight(i, extra); } return row; }
return 0; if (firsttime) row.setWidths(absoluteWidths); float height = row.getMaxHeights(); PdfPCell cell; PdfPRow tmprow; cell = tmprow.getCells()[i]; float tmp = 0; if (cell.getRowspan() == rs + 1) { height = tmp; row.setMaxHeights(height); return height;
if (row != null && row.getCells()[k] != null) { newCells[k] = new PdfPCell(row.getCells()[k]); newCells[k].consumeHeight(newHeight); newCells[k].setRowspan(row.getCells()[k].getRowspan() - rowIndex + index); allEmpty = false; case 90: case 270: y = setColumn(ct, bottom, left, top, right); break; default: y = setColumn(ct, left, bottom, cell.isNoWrap() ? RIGHT_LIMIT : right, top); break; calculateHeights(); PdfPRow split = new PdfPRow(newCells); split.widths = widths.clone(); split.calculateHeights(); return split;
PdfPRow row = getRow(rowIndex); if (row != null) { PdfPCell replaceCell = row.getCells()[colIndex]; if (replaceCell != null) { firstRow.getCells()[colIndex] = new PdfPCell(replaceCell); float extra = 0; int stop = Math.min(rowIndex + replaceCell.getRowspan(), end); extra += getRowHeight(j); firstRow.setExtraHeight(colIndex, extra); float diff = getRowspanHeight(rowIndex, colIndex) - getRowHeight(start) - extra; firstRow.getCells()[colIndex].consumeHeight(diff); cell = firstRow.getCells()[colIndex]; if (cell == null) colIndex++;
PdfPRow row = new PdfPRow(currentRow); if (totalWidth > 0) { row.setWidths(absoluteWidths); totalHeight += row.getMaxHeights();
calculateHeights(); if (colEnd < 0) colEnd = cells.length; float currentMaxHeight = maxHeight + extraHeights[k]; writeBorderAndBackground(xPos, yPos, currentMaxHeight, cell, canvases); break; saveAndRotateCanvases(canvases, 0,1,-1,0,pivotX,pivotY); break; saveAndRotateCanvases(canvases, 0,-1,1,0,pivotX,pivotY); throw new ExceptionConverter(e); } finally { restoreCanvases(canvases); float shx = leftLimit + rightLimit; float shy = yPos + yPos - currentMaxHeight + cell.getEffectivePaddingBottom() - cell.getEffectivePaddingTop(); saveAndRotateCanvases(canvases, -1,0,0,-1,shx,shy); } finally { if (cell.getRotation() == 180) { restoreCanvases(canvases);
PdfPRow newRow = table.getRow(k).splitRow(table, k, h); if (newRow == null) { if (k == listIdx) PdfPRow last = (PdfPRow)sub.get(sub.size() - 1 - footerRows); if (table.isExtendLastRow()) { rowHeight = last.getMaxHeights(); last.setMaxHeights(yTemp - minY + rowHeight); yTemp = minY; nt.writeSelectedRows(0, -1, x1, yLineWrite, canvas); if (table.isExtendLastRow()) { last.setMaxHeights(rowHeight);
PdfPRow row = (PdfPRow)rows.get(k); if (row != null) { row.writeCells(colStart, colEnd, xPos, yPos, canvases); yPos -= row.getMaxHeights(); float hr = 0; if (row != null) hr = row.getMaxHeights(); heights[k - rowStart + 1] = heights[k - rowStart] - hr;
/** * Gets the maximum height of the row (i.e. of the 'highest' cell). * * @return the maximum height of the row */ public float getMaxHeights() { if (calculated) return maxHeight; return calculateHeights(); }
/** * Constructs a copy of a <CODE>PdfPTable</CODE>. * * @param table the <CODE>PdfPTable</CODE> to be copied */ public PdfPTable(PdfPTable table) { copyFormat(table); for (int k = 0; k < currentRow.length; ++k) { if (table.currentRow[k] == null) break; currentRow[k] = new PdfPCell(table.currentRow[k]); } for (int k = 0; k < table.rows.size(); ++k) { PdfPRow row = (PdfPRow)(table.rows.get(k)); if (row != null) row = new PdfPRow(row); rows.add(row); } }
++n; else widths[n++] = row.getEventWidth(xPos); ++n; else widths[n++] = row.getEventWidth(xPos);
return 0; if (firsttime) row.setWidths(absoluteWidths); float height = row.getMaxHeights(); PdfPCell cell; PdfPRow tmprow; cell = tmprow.getCells()[i]; float tmp = 0; if (cell.getRowspan() == rs + 1) { height = tmp; row.setMaxHeights(height); return height;
if (row != null && row.getCells()[k] != null) { newCells[k] = new PdfPCell(row.getCells()[k]); newCells[k].consumeHeight(newHeight); newCells[k].setRowspan(row.getCells()[k].getRowspan() - rowIndex + index); allEmpty = false; case 90: case 270: y = setColumn(ct, bottom, left, top, right); break; default: y = setColumn(ct, left, bottom, cell.isNoWrap() ? RIGHT_LIMIT : right, top); break; calculateHeights(); PdfPRow split = new PdfPRow(newCells); split.widths = (float[]) widths.clone(); split.calculateHeights(); return split;
PdfPRow row = getRow(rowIndex); if (row != null) { PdfPCell replaceCell = row.getCells()[colIndex]; if (replaceCell != null) { firstRow.getCells()[colIndex] = new PdfPCell(replaceCell); float extra = 0; int stop = Math.min(rowIndex + replaceCell.getRowspan(), end); extra += getRowHeight(j); firstRow.setExtraHeight(colIndex, extra); float diff = getRowspanHeight(rowIndex, colIndex) - getRowHeight(start) - extra; firstRow.getCells()[colIndex].consumeHeight(diff); cell = firstRow.getCells()[colIndex]; if (cell == null) colIndex++;
PdfPRow row = new PdfPRow(currentRow); if (totalWidth > 0) { row.setWidths(absoluteWidths); totalHeight += row.getMaxHeights();
calculateHeights(); if (colEnd < 0) colEnd = cells.length; float currentMaxHeight = maxHeight + extraHeights[k]; writeBorderAndBackground(xPos, yPos, currentMaxHeight, cell, canvases); break; saveAndRotateCanvases(canvases, 0,1,-1,0,pivotX,pivotY); break; saveAndRotateCanvases(canvases, 0,-1,1,0,pivotX,pivotY); throw new ExceptionConverter(e); } finally { restoreCanvases(canvases); float shx = leftLimit + rightLimit; float shy = yPos + yPos - currentMaxHeight + cell.getEffectivePaddingBottom() - cell.getEffectivePaddingTop(); saveAndRotateCanvases(canvases, -1,0,0,-1,shx,shy); } finally { if (cell.getRotation() == 180) { restoreCanvases(canvases);
PdfPRow newRow = table.getRow(k).splitRow(table, k, h); if (newRow == null) { if (k == listIdx) PdfPRow last = (PdfPRow)sub.get(index); if (table.isExtendLastRow(newPageFollows)) { rowHeight = last.getMaxHeights(); last.setMaxHeights(yTemp - minY + rowHeight); yTemp = minY; nt.writeSelectedRows(0, -1, x1, yLineWrite, canvas); if (table.isExtendLastRow(newPageFollows)) { last.setMaxHeights(rowHeight);
PdfPRow row = (PdfPRow)rows.get(k); if (row != null) { row.writeCells(colStart, colEnd, xPos, yPos, canvases); yPos -= row.getMaxHeights(); float hr = 0; if (row != null) hr = row.getMaxHeights(); heights[k - rowStart + 1] = heights[k - rowStart] - hr;