+ /**
+ * Underlines the contents of a cell, but not the cell padding area.
+ * Primarily useful for the last line before a "totals" line.
+ * @param int $c Column number to underline.
+ * @param int $r Print the underline(s) this number of rows below the current position. Can be negative in order to go up.
+ * @param int $type Type of underlining to draw. Possible values are:<ul><li>1: single underline (default)</li><li>2: double underline</li></ul>
+ * @param int $linewidth Thickness of the line to draw. Default value of zero will use the current line width defined for this document.
+ * @param array $style Line style. Array like for {@link SetLineStyle SetLineStyle}. Default value: default line style (empty array).
+ * @access public
+ * @see SetLineWidth(), SetDrawColor(), SetLineStyle()
+ */
+ function UnderlineCell($c, $r = 0, $type = 1, $linewidth = 0, $style = array())
+ {
+ // If line width was specified, save current setting so we can reset it
+ if ($linewidth != 0)
+ {
+ $oldLineWidth = $this->GetLineWidth();
+ $this->SetLineWidth($linewidth);
+ }
+
+ // Figure out how far down to move the line based on current font size
+ // Calculate this because printing underline directly at $this->row goes on top
+ // of the parts of characters that "hang down", like the bottom of commas &
+ // lowercase letter 'g', etc.
+ if ($this->fontSize < 10)
+ $y_adj = 2;
+ else
+ $y_adj = 3;
+ parent::line($this->cols[$c] + $this->cMargin, $this->row - $r - $y_adj, $this->cols[$c + 1] - $this->cMargin, $this->row - $r - $y_adj, $style);
+
+ // Double underline, far enough below the first underline so as not to overlap
+ // the first underline (depends on current line thickness (aka "line width")
+ if ($type == 2)
+ parent::line($this->cols[$c] + $this->cMargin, $this->row - $r - $y_adj - ($this->GetLineWidth() + 2), $this->cols[$c + 1] - $this->cMargin, $this->row - $r - $y_adj - ($this->GetLineWidth() + 2), $style);
+
+ // If line width was specified, reset it back to the original setting
+ if ($linewidth != 0)
+ $this->SetLineWidth($oldLineWidth);
+ }
+
+ function NewLine($l=1, $np=0, $h = NULL)