code: public ArrayList getLines(float top, float bottom) {
          float lineHeight;
          float currentPosition = Math.min(getTop(), top);
          setTop(currentPosition + cellspacing);
          ArrayList result = new ArrayList();
  
          // if the bottom of the page is higher than the top of the cell: do nothing
          if (getTop() < bottom) {
              return result;
          }
          
          // we loop over the lines
          int size = lines.size();
          boolean aboveBottom = true;
          for (int i = 0; i < size && aboveBottom; i++) {
              line = (PdfLine) lines.get(i);
              lineHeight = line.height();
              currentPosition -= lineHeight;
              // if the currentPosition is higher than the bottom, we add the line to the result
              if (currentPosition > (bottom + cellpadding + getBorderWidthInside(BOTTOM))) {
                  result.add(line);
              } else {
                  aboveBottom = false;
              }
          }
          // if the bottom of the cell is higher than the bottom of the page, the cell is written, so we can remove all lines
          float difference = 0f;
          if (!header) {
              if (aboveBottom) {
                  lines = new ArrayList();
                  contentHeight = 0f;
              } else {
                  size = result.size();
                  for (int i = 0; i < size; i++) {
                      line = removeLine(0);
                      difference += line.height();
                  }
              }
          }
          if (difference > 0) {
              Image image;
              for (Iterator i = images.iterator(); i.hasNext();) {
                  image = (Image) i.next();
                  image.setAbsolutePosition(image.getAbsoluteX(), image.getAbsoluteY() - difference - leading);
              }
          }
          return result;
      }
docs: Gets the lines of a cell that can be drawn between certain limits.
  <P>
  Remark: all the lines that can be drawn are removed from the object!
  
  @param	top		the top of the part of the table that can be drawn
  @param	bottom	the bottom of the part of the table that can be drawn
  @return	an <CODE>ArrayList</CODE> of <CODE>PdfLine</CODE>s