title: FPDF align with Image and Cell
body: <p>I'm trying to do the following layout in an PDF file generated by FPDF in PHP.</p>
  
  <pre><code>--------------------------------------------------
  |                        |       Text1           |
  |  IMAGE                 |       Text2           |
  |                        |       Text3           | 
  --------------------------------------------------
  </code></pre>
  
  <p>But I couldn't figure out how to do it by now.</p>
  
  <p>This is the code I'm using</p>
  
  <pre><code>public function floatingImage($imgPath, $height) {
  
      list($w, $h) = getimagesize($imgPath);
      $ratio = $w / $h;
      $imgWidth = $height * $ratio;
      $this-&gt;Image($imgPath, $this-&gt;GetX(), $this-&gt;GetY(), 140, 100);
      $this-&gt;x += $imgWidth;
  }
  
  /* Logbuch is our extension from FPDI, but there's nothing changed
   * only a custom header, footer and the floatingImage and loadMapImage function are part of it
   */
  $pdf = new logbuch();
  
  // Frontpage
  $pdf-&gt;AddPage();
  
  $mapImage = $pdf-&gt;loadMapImage();
  $pdf-&gt;setJPEGQuality(75);
  $x = 15; $y = 21; $w = 100;
  $pdf-&gt;floatingImage($mapImage, 100, 100);
  
  $pdf-&gt;SetFillColor(154,222,229);
  $pdf-&gt;Cell(0,0,"Test",0,0,'R',true);
  $pdf-&gt;Ln();
  $pdf-&gt;Cell(100,0,"Test",0,0,'R',true);
  $pdf-&gt;Ln();
  $pdf-&gt;Cell(100,0,"Test",0,0,'R',true);
  </code></pre>
  
  <p>This is the result I'm generating by now</p>
  
  <p><a href="https://i.stack.imgur.com/LEWUA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LEWUA.png" alt="result by now"></a></p>
  
  <p>If I change the width of the last two cells to 100 it will look like this:</p>
  
  <p><a href="https://i.stack.imgur.com/OScNs.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OScNs.png" alt="If Cell Width is set to 100"></a></p>
  
  <p>This is <strong>nearly</strong> what I want, the cells just must align to the right side. How can I do this?</p>