private void flushCurrentLine() { if (line != null && line.size() > 0) { addLine(line); } }
/** * Sets the bottom of the Rectangle and determines the proper {link #verticalOffset} * to appropriately align the contents vertically. * @param value */ public void setBottom(float value) { super.setBottom(value); float firstLineRealHeight = firstLineRealHeight(); float totalHeight = ury - value; // can't use top (already compensates for cellspacing) float nonContentHeight = (cellpadding() * 2f) + (cellspacing() * 2f); nonContentHeight += getBorderWidthInside(TOP) + getBorderWidthInside(BOTTOM); float interiorHeight = totalHeight - nonContentHeight; float extraHeight = 0.0f; switch (verticalAlignment) { case Element.ALIGN_BOTTOM: extraHeight = interiorHeight - contentHeight; break; case Element.ALIGN_MIDDLE: extraHeight = (interiorHeight - contentHeight) / 2.0f; break; default: // ALIGN_TOP extraHeight = 0f; } extraHeight += cellpadding() + cellspacing(); extraHeight += getBorderWidthInside(TOP); if (firstLine != null) { firstLine.height = firstLineRealHeight + extraHeight; } }
switch (side) { case Rectangle.LEFT: width = getBorderWidthLeft(); break; width = getBorderWidthRight(); break; width = getBorderWidthTop(); break; width = getBorderWidthBottom(); break; if (!isUseVariableBorders()) { width = width / 2f;
cloneNonPositionParameters(cell); this.cellpadding = cellpadding; this.cellspacing = cellspacing; left += getBorderWidthInside(LEFT); right -= getBorderWidthInside(RIGHT); case Element.IMGRAW: case Element.IMGTEMPLATE: addImage((Image) element, left, right, 0.4f * leading, alignment); // break; if (line != null && line.size() > 0) { line.resetAlignment(); addLine(line); addList((List)element, left, right, alignment); line = new PdfLine(left, right, alignment, leading); break; processActions(element, null, allActions); aCounter = 0; addLine(line); // add empty line - all cells need some lines even if they are empty line = new PdfLine(currentLeft, currentRight, alignment, currentLineLeading); chunk = new PdfChunk(c, (PdfAction) (allActions.get(aCounter++))); while ((overflow = line.add(chunk)) != null) { addLine(line);
cell = (Cell) row.getCell(i); if (cell != null) { currentCell = new PdfCell(cell, rowNumber+prevRows, positions[i], positions[i + cell.getColspan()], offsets[rowNumber], cellspacing(), cellpadding()); if (rowNumber < firstDataRow) { currentCell.setHeader(); headercells.add(currentCell); if (!table.isNotAddedYet()) if (offsets[rowNumber] - currentCell.getHeight() - cellpadding() < offsets[rowNumber + currentCell.rowspan()]) { offsets[rowNumber + currentCell.rowspan()] = offsets[rowNumber] - currentCell.getHeight() - cellpadding(); if (offsets[rowNumber] - currentCell.getHeight() < offsets[rows - 1]) { offsets[rows - 1] = offsets[rowNumber] - currentCell.getHeight(); currentCell.setGroupNumber(groupNumber); groupChange |= cell.getGroupChange(); newCells.add(currentCell); currentCell = (PdfCell) newCells.get(i); try { currentCell.setBottom(offsets[currentCell.rownumber()-prevRows + currentCell.rowspan()]); currentCell.setBottom(offsets[rows - 1]);
PdfChunk overflow; ArrayList allActions = new ArrayList(); processActions(list, null, allActions); int aCounter = 0; for (Iterator it = list.getItems().iterator(); it.hasNext();) { chunk = new PdfChunk((Chunk) j.next(), (PdfAction) (allActions.get(aCounter++))); while ((overflow = line.add(chunk)) != null) { addLine(line); line = new PdfLine(left + item.getIndentationLeft(), right, alignment, item.getLeading()); chunk = overflow; addLine(line); line = new PdfLine(left + item.getIndentationLeft(), right, alignment, leading); case Element.LIST: List sublist = (List)ele; addList(sublist, left + sublist.getIndentationLeft(), right, alignment); break;
image.scaleToFit(right - left, Float.MAX_VALUE); flushCurrentLine(); if (line == null) { line = new PdfLine(left, right, alignment, leading); addLine(imageLine); return imageLine.height();
private PdfLine removeLine(int index) { PdfLine oldLine = (PdfLine) lines.remove(index); contentHeight -= oldLine.height(); if (index == 0) { if (!lines.isEmpty()) { firstLine = (PdfLine) lines.get(0); float firstLineRealHeight = firstLineRealHeight(); contentHeight -= firstLine.height(); firstLine.height = firstLineRealHeight; contentHeight += firstLineRealHeight; } } return oldLine; }
cloneNonPositionParameters(cell); this.cellpadding = cellpadding; this.cellspacing = cellspacing; left += getBorderWidthInside(LEFT); right -= getBorderWidthInside(RIGHT); case Element.IMGRAW: case Element.IMGTEMPLATE: addImage((Image) element, left, right, 0.4f * leading, alignment); // break; if (line != null && line.size() > 0) { line.resetAlignment(); addLine(line); addList((List)element, left, right, alignment); line = new PdfLine(left, right, alignment, leading); break; processActions(element, null, allActions); aCounter = 0; addLine(line); // add empty line - all cells need some lines even if they are empty line = new PdfLine(currentLeft, currentRight, alignment, currentLineLeading); chunk = new PdfChunk(c, (PdfAction) (allActions.get(aCounter++))); while ((overflow = line.add(chunk)) != null) { addLine(line);
cell = (Cell) row.getCell(i); if (cell != null) { currentCell = new PdfCell(cell, rowNumber+prevRows, positions[i], positions[i + cell.getColspan()], offsets[rowNumber], cellspacing(), cellpadding()); if (rowNumber < firstDataRow) { currentCell.setHeader(); headercells.add(currentCell); if (!table.isNotAddedYet()) if (offsets[rowNumber] - currentCell.getHeight() - cellpadding() < offsets[rowNumber + currentCell.rowspan()]) { offsets[rowNumber + currentCell.rowspan()] = offsets[rowNumber] - currentCell.getHeight() - cellpadding(); if (offsets[rowNumber] - currentCell.getHeight() < offsets[rows - 1]) { offsets[rows - 1] = offsets[rowNumber] - currentCell.getHeight(); currentCell.setGroupNumber(groupNumber); groupChange |= cell.getGroupChange(); newCells.add(currentCell); currentCell = (PdfCell) newCells.get(i); try { currentCell.setBottom(offsets[currentCell.rownumber()-prevRows + currentCell.rowspan()]); currentCell.setBottom(offsets[rows - 1]);
PdfChunk overflow; ArrayList allActions = new ArrayList(); processActions(list, null, allActions); int aCounter = 0; for (Iterator it = list.getItems().iterator(); it.hasNext();) { chunk = new PdfChunk((Chunk) j.next(), (PdfAction) (allActions.get(aCounter++))); while ((overflow = line.add(chunk)) != null) { addLine(line); line = new PdfLine(left + item.getIndentationLeft(), right, alignment, item.getLeading()); chunk = overflow; addLine(line); line = new PdfLine(left + item.getIndentationLeft(), right, alignment, leading); case Element.LIST: List sublist = (List)ele; addList(sublist, left + sublist.getIndentationLeft(), right, alignment); break;
image.scaleToFit(right - left, Float.MAX_VALUE); flushCurrentLine(); if (line == null) { line = new PdfLine(left, right, alignment, leading); addLine(imageLine); return imageLine.height();
private PdfLine removeLine(int index) { PdfLine oldLine = (PdfLine) lines.remove(index); contentHeight -= oldLine.height(); if (index == 0) { if (!lines.isEmpty()) { firstLine = (PdfLine) lines.get(0); float firstLineRealHeight = firstLineRealHeight(); contentHeight -= firstLine.height(); firstLine.height = firstLineRealHeight; contentHeight += firstLineRealHeight; } } return oldLine; }
cloneNonPositionParameters(cell); this.cellpadding = cellpadding; this.cellspacing = cellspacing; left += getBorderWidthInside(LEFT); right -= getBorderWidthInside(RIGHT); case Element.IMGRAW: case Element.IMGTEMPLATE: addImage((Image) element, left, right, 0.4f * leading, alignment); // break; if (line != null && line.size() > 0) { line.resetAlignment(); addLine(line); addList((List)element, left, right, alignment); line = new PdfLine(left, right, alignment, leading); break; processActions(element, null, allActions); aCounter = 0; addLine(line); // add empty line - all cells need some lines even if they are empty line = new PdfLine(currentLeft, currentRight, alignment, currentLineLeading); chunk = new PdfChunk(c, (PdfAction) (allActions.get(aCounter++))); while ((overflow = line.add(chunk)) != null) { addLine(line);
cell = (Cell) row.getCell(i); if (cell != null) { currentCell = new PdfCell(cell, rowNumber+prevRows, positions[i], positions[i + cell.getColspan()], offsets[rowNumber], cellspacing(), cellpadding()); if (rowNumber < firstDataRow) { currentCell.setHeader(); headercells.add(currentCell); if (!table.isNotAddedYet()) if (offsets[rowNumber] - currentCell.getHeight() - cellpadding() < offsets[rowNumber + currentCell.rowspan()]) { offsets[rowNumber + currentCell.rowspan()] = offsets[rowNumber] - currentCell.getHeight() - cellpadding(); if (offsets[rowNumber] - currentCell.getHeight() < offsets[rows - 1]) { offsets[rows - 1] = offsets[rowNumber] - currentCell.getHeight(); currentCell.setGroupNumber(groupNumber); groupChange |= cell.getGroupChange(); newCells.add(currentCell); currentCell = (PdfCell) newCells.get(i); try { currentCell.setBottom(offsets[currentCell.rownumber()-prevRows + currentCell.rowspan()]); currentCell.setBottom(offsets[rows - 1]);
switch (side) { case Rectangle.LEFT: width = getBorderWidthLeft(); break; width = getBorderWidthRight(); break; width = getBorderWidthTop(); break; width = getBorderWidthBottom(); break; if (!isUseVariableBorders()) { width = width / 2f;
/** * Sets the bottom of the Rectangle and determines the proper {link #verticalOffset} * to appropriately align the contents vertically. * @param value */ public void setBottom(float value) { super.setBottom(value); float firstLineRealHeight = firstLineRealHeight(); float totalHeight = ury - value; // can't use top (already compensates for cellspacing) float nonContentHeight = (cellpadding() * 2f) + (cellspacing() * 2f); nonContentHeight += getBorderWidthInside(TOP) + getBorderWidthInside(BOTTOM); float interiorHeight = totalHeight - nonContentHeight; float extraHeight = 0.0f; switch (verticalAlignment) { case Element.ALIGN_BOTTOM: extraHeight = interiorHeight - contentHeight; break; case Element.ALIGN_MIDDLE: extraHeight = (interiorHeight - contentHeight) / 2.0f; break; default: // ALIGN_TOP extraHeight = 0f; } extraHeight += cellpadding() + cellspacing(); extraHeight += getBorderWidthInside(TOP); if (firstLine != null) { firstLine.height = firstLineRealHeight + extraHeight; } }
PdfChunk overflow; ArrayList allActions = new ArrayList(); processActions(list, null, allActions); int aCounter = 0; for (Iterator it = list.getItems().iterator(); it.hasNext();) { chunk = new PdfChunk((Chunk) j.next(), (PdfAction) (allActions.get(aCounter++))); while ((overflow = line.add(chunk)) != null) { addLine(line); line = new PdfLine(left + item.getIndentationLeft(), right, alignment, item.getLeading()); chunk = overflow; addLine(line); line = new PdfLine(left + item.getIndentationLeft(), right, alignment, leading); case Element.LIST: List sublist = (List)ele; addList(sublist, left + sublist.getIndentationLeft(), right, alignment); break;
image.scaleToFit(right - left, Float.MAX_VALUE); flushCurrentLine(); if (line == null) { line = new PdfLine(left, right, alignment, leading); addLine(imageLine); return imageLine.height();
private void flushCurrentLine() { if (line != null && line.size() > 0) { addLine(line); } }