Menu

Height Parameter in MultiCell?

Help
Red
2008-06-03
2012-10-09
  • Red

    Red - 2008-06-03

    Hi again!
    I try to change the Line-Height of the lines within MultiCell. From the documentation I learned this will be controlled by the height-parameter.
    The following look all the same:

    $pdf->MultiCell(0,5,$text,0,'L',0,1);
    $pdf->MultiCell(0,15,$text,0,'L',0,1);
    $pdf->MultiCell(0,250,$text,0,'L',0,1);

    Is this second parameter ignored?
    Greets and thanks
    red

     
    • Jon B

      Jon B - 2008-06-03

      I think you're having the same problem as me. See this thread:

      https://sourceforge.net/forum/forum.php?thread_id=1962139&forum_id=435311

      I hope you have better luck than I had. I'm still using TCPDF v2.6 in order to get around it.

       
    • Nicola Asuni

      Nicola Asuni - 2008-06-03

      ... I'm going to fixing it. Please wait...

       
    • Red

      Red - 2008-06-04

      Hm, took a look. It seems 3.0.013 didn't cut it for me. And I read the Thread mentioned by Jon. He is right. It is the same issue now. I have some troubles with having the K_CELL_HEIGHT_RATIO defined as a constant without any possibility to override it. I have the issue to change the Line-Height within one PDF-Document so I have to change the value defined in K_CELL_HEIGHT_RATIO during generation.
      Now I only have 2 solutions (which both are not very good):

      • I create the whole documents with just using the Cell-Method. Very inconvenient.
      • I extend the TCPDF-Class and do implement my 'own' MultiCell-Method (copy/paste) just to change one or two lines. The problem with this is I have to think about that everytime I update the TCPDF-Class and will have to check for the changes between my new implementation and yours.

      I think it would be nice to have calculated the cell_height by something like:

      $min_cell_height = $this->FontSize * (!$cell_height_ratio? $cell_height_ratio : K_CELL_HEIGHT_RATIO);

      Thanks for your help
      red

       
      • Nicola Asuni

        Nicola Asuni - 2008-06-04

        OK, done!
        The latest TCPDF 3.0.014 contains a new method setCellHeightRatio() to set the value of the new $cell_height_ratio variable that is used instead of K_CELL_HEIGHT_RATIO constant (the default value).

         
        • Red

          Red - 2008-06-04

          Thank you very much! This is what I call fast response!
          Great
          red

           
        • Red

          Red - 2008-06-05

          Thanks. Works like a charm!

           
    • Nicola Asuni

      Nicola Asuni - 2008-06-03

      OK, fixed on TCPDF 3.0.013.

       
    • Red

      Red - 2008-06-03

      Thanks! I'll take a look this thursday.

       

Log in to post a comment.