Codota Logo
PdfCell
Code IndexAdd Codota to your IDE (free)

How to use
PdfCell
in
com.lowagie.text.pdf

Best Java code snippets using com.lowagie.text.pdf.PdfCell (Showing top 20 results out of 405)

  • Common ways to obtain PdfCell
private void myMethod () {
PdfCell p =
  • Codota IconIterator iterator;(PdfCell) iterator.next()
  • Codota IconArrayList arrayList;(PdfCell) arrayList.get(index)
  • Smart code suggestions by Codota
}
origin: fr.opensagres.xdocreport.itext-gae/itext-gae

private void flushCurrentLine() {
  if (line != null && line.size() > 0) {
    addLine(line);
  }
}
origin: fr.opensagres.xdocreport.itext-gae/itext-gae

/**
 * 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;
  }
}
origin: es.gob.afirma/afirma-crypto-pdf-itext

switch (side) {
  case Rectangle.LEFT:
    width = getBorderWidthLeft();
    break;
    width = getBorderWidthRight();
    break;
    width = getBorderWidthTop();
    break;
    width = getBorderWidthBottom();
    break;
if (!isUseVariableBorders()) {
  width = width / 2f;
origin: es.gob.afirma/afirma-crypto-pdf-itext

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);
origin: com.github.librepdf/openpdf

    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]);
origin: com.github.librepdf/openpdf

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;
origin: com.github.librepdf/openpdf

  image.scaleToFit(right - left, Float.MAX_VALUE);
flushCurrentLine();
if (line == null) {
  line = new PdfLine(left, right, alignment, leading);
addLine(imageLine);
return imageLine.height();
origin: com.github.librepdf/openpdf

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;
}
origin: fr.opensagres.xdocreport.itext-gae/itext-gae

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);
origin: es.gob.afirma/afirma-crypto-pdf-itext

    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]);
origin: es.gob.afirma/afirma-crypto-pdf-itext

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;
origin: es.gob.afirma/afirma-crypto-pdf-itext

  image.scaleToFit(right - left, Float.MAX_VALUE);
flushCurrentLine();
if (line == null) {
  line = new PdfLine(left, right, alignment, leading);
addLine(imageLine);
return imageLine.height();
origin: fr.opensagres.xdocreport.itext-gae/itext-gae

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;
}
origin: com.github.librepdf/openpdf

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);
origin: fr.opensagres.xdocreport.itext-gae/itext-gae

    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]);
origin: com.github.librepdf/openpdf

switch (side) {
  case Rectangle.LEFT:
    width = getBorderWidthLeft();
    break;
    width = getBorderWidthRight();
    break;
    width = getBorderWidthTop();
    break;
    width = getBorderWidthBottom();
    break;
if (!isUseVariableBorders()) {
  width = width / 2f;
origin: com.github.librepdf/openpdf

/**
 * 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;
  }
}
origin: fr.opensagres.xdocreport.itext-gae/itext-gae

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;
origin: fr.opensagres.xdocreport.itext-gae/itext-gae

  image.scaleToFit(right - left, Float.MAX_VALUE);
flushCurrentLine();
if (line == null) {
  line = new PdfLine(left, right, alignment, leading);
addLine(imageLine);
return imageLine.height();
origin: com.github.librepdf/openpdf

private void flushCurrentLine() {
  if (line != null && line.size() > 0) {
    addLine(line);
  }
}
com.lowagie.text.pdfPdfCell

Javadoc

A PdfCell is the PDF translation of a Cell.

A PdfCell is an ArrayList of PdfLines.

When using variable borders ( com.lowagie.text.Rectangle#isUseVariableBorders == true), the borders are drawn completely inside the cell Rectangle so that adjacent cell borders will not overlap. Otherwise, the borders are drawn on top of the edges of the cell Rectangle and will overlap the borders of adjacent cells.

Most used methods

  • <init>
    Constructs a PdfCell-object.
  • addImage
    Adds an image to this Cell.
  • addLine
  • addList
  • cellpadding
    Gets the cellpadding of a cell..
  • cellspacing
    Gets the cellspacing of a cell.
  • cloneNonPositionParameters
  • firstLineRealHeight
    Calculates what the height of the first line should be so that the content will be flush with the to
  • flushCurrentLine
  • getBorderWidthBottom
  • getBorderWidthInside
    Gets the amount of the border for the specified side that is inside the Rectangle. For non-variable
  • getBorderWidthLeft
  • getBorderWidthInside,
  • getBorderWidthLeft,
  • getBorderWidthRight,
  • getBorderWidthTop,
  • getBottom,
  • getHeight,
  • getImages,
  • getLeft,
  • getLines,
  • getRight

Popular in Java

  • Running tasks concurrently on multiple threads
  • notifyDataSetChanged (ArrayAdapter)
  • onCreateOptionsMenu (Activity)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • Pattern (java.util.regex)
    A compiled representation of a regular expression. A regular expression, specified as a string, must
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now