code: public void writeBorderAndBackground(float xPos, float yPos, float currentMaxHeight, PdfPCell cell, PdfContentByte[] canvases) {
  		Color background = cell.getBackgroundColor();
  		if (background != null || cell.hasBorders()) {
  			// Add xPos resp. yPos to the cell's coordinates for absolute coordinates
  			float right = cell.getRight() + xPos;
  			float top = cell.getTop() + yPos;
  			float left = cell.getLeft() + xPos;
  			float bottom = top - currentMaxHeight;
  			
  			if (background != null) {
  				PdfContentByte backgr = canvases[PdfPTable.BACKGROUNDCANVAS];
  				backgr.setColorFill(background);
  				backgr.rectangle(left, bottom, right - left, top - bottom);
  				backgr.fill();
  			}
  			if (cell.hasBorders()) {
  				Rectangle newRect = new Rectangle(left, bottom, right, top);
  				// Clone non-position parameters except for the background color
  				newRect.cloneNonPositionParameters(cell);
  				newRect.setBackgroundColor(null);
  				// Write the borders on the line canvas
  				PdfContentByte lineCanvas = canvases[PdfPTable.LINECANVAS];
  				lineCanvas.rectangle(newRect);
  			}
  		}
  	}
docs: Writes the border and background of one cell in the row.
  
  @param xPos The x-coordinate where the table starts on the canvas
  @param yPos The y-coordinate where the table starts on the canvas
  @param currentMaxHeight The height of the cell to be drawn.
  @param cell
  @param canvases
  @since	2.1.6	extra parameter currentMaxHeight