0

I have a text which contains ±50 words. So I want to add it in the same cell here is my code:

//header
$this->SetX(30);
$this->Cell(270, 20, "Suggested Improvement ",0, 0, 'C', true);

$this->SetX(300);
$this->Cell(270, 20, "Current Situation ",0, 0, 'C', true);


//data retrieved from DB
$this->Ln(20);
$this->SetTextColor(0); 
$this->SetFillColor(19, 68, 160);
$this->SetLineWidth(0.25);

$this->SetX(30.5);
$this->Cell(269, 100,$row1['Suggested Improvement'], 1, 0, 'C', false);

$this->SetX(300);
$this->Cell(269.5, 100,$row1['Current Situation'], 1, 0, 'L', false);

But the problem is that the text is not filled in the cell, it is printed as one line, as it is shown here:

How can I make the text to start from the top right and to be filled in this block only?

insertusernamehere
  • 23,204
  • 9
  • 87
  • 126
Rawabi.a
  • 35
  • 9

1 Answers1

0

Think you are using fpdf for php..

Have a look at MultiCell. There you can youse \n for line-break.

$this->MultiCell(100,8,"Line 1\n Line2");

You have to do the line-break on your own. Its not automaticly added.

Here you can check the witdh with GetStringWidth and add some line-breaks.

StrongLucky
  • 568
  • 5
  • 15