3

I'm trying to work out the height of a WriteHTMLCell box.. I thought I could use the difference between the Y position before and after calling WriteHTMLCell()....

$start_y    = $pdf->GetY();

$pdf->WriteHTMLCell(
    $w,
    0,  // min height
    $xpos, // XPos
    $ypos,  // YPos
    $text,
    1, // border
    0, // ln
    false, // fill
    false, // reseth
    "R"
);

$end_y    = $pdf->GetY();

..But $start_y always equals $end_y (NB, the x position does move)

The tcpdf manual Says this.. "After the call, the current position moves to the right or to the next line." ... but it doesn't say why it moves to the right and not to the next line.

NB, I have done extensive research. This question may appear similar to Another stack overflow question - However, this is for a different tcpdf call.

Community
  • 1
  • 1
Rob
  • 453
  • 1
  • 7
  • 14

1 Answers1

8

The answer was to change the argument $ln to 1

$pdf->WriteHTMLCell(
  $w,
  0,  // min height
  $xpos, // XPos
  $ypos,  // YPos
  $text,
  1, // border
  1, // ln
  false, // fill
  false, // reseth
  "R"
);
Rob
  • 453
  • 1
  • 7
  • 14