title: Image and text formating in TCPDF
body: <p>Using TCPDF to generate my HTML in PDF. But text formatting is not coming and image is not present in PDF.
  What is the issue. ?</p>
  
  <p><strong>PHP Code:</strong></p>
  
  <pre><code>require_once('tcpdf/tcpdf.php');
  
  // create new PDF document
  $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
  
  // set document information
  $pdf-&gt;SetCreator(PDF_CREATOR);
  // set default header data
  // $pdf-&gt;SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 021', PDF_HEADER_STRING);
  
  // set header and footer fonts
  $pdf-&gt;setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
  $pdf-&gt;setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
  
  // set default monospaced font
  $pdf-&gt;SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
  
  // set margins
  $pdf-&gt;SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
  $pdf-&gt;SetHeaderMargin(PDF_MARGIN_HEADER);
  $pdf-&gt;SetFooterMargin(PDF_MARGIN_FOOTER);
  
  // set auto page breaks
  $pdf-&gt;SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
  
  // set image scale factor
  $pdf-&gt;setImageScale(PDF_IMAGE_SCALE_RATIO);
  
  // set some language-dependent strings (optional)
  if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
      require_once(dirname(__FILE__).'/lang/eng.php');
      $pdf-&gt;setLanguageArray($l);
  }
  
  // set font
  $pdf-&gt;SetFont('helvetica', '', 9);
  
  // add a page
  $pdf-&gt;AddPage();
  // create some HTML content
  
  /*---------*/
  $html  = 'HTML Content Which is pasted under the HTML head in this Question'; 
  
  // output the HTML content
  $pdf-&gt;writeHTML($html, true, 0, true, 0);
  
  // reset pointer to the last page
  $pdf-&gt;lastPage();
  ob_end_clean();
  //Close and output PDF document
  $pdf-&gt;Output('rec_users.pdf','D');
  </code></pre>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;table&gt;
          &lt;tbody&gt;
              &lt;tr&gt;
                  &lt;td style='background:red'&gt;&amp;nbsp;&lt;/td&gt;
  
                  &lt;td&gt;&lt;img alt='' height='129' src=
                  'demo-300x300.jpg'
                  width='300'&gt;&lt;/td&gt;
  
                  &lt;td&gt;
                      &lt;div class='header'&gt;
                          &lt;div class='right'&gt;
                              &lt;p&gt;1790 lee Travino&lt;/p&gt;
  
                              &lt;p&gt;CL paso xyz&lt;/p&gt;
  
                              &lt;p&gt;T-123456789&lt;/p&gt;
  
                              &lt;p&gt;F-45678903&lt;/p&gt;
  
                              &lt;p&gt;wwww.xyz.com&lt;/p&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
  
              &lt;tr&gt;
                  &lt;td style='background:red'&gt;&amp;nbsp;&lt;/td&gt;
  
                  &lt;td&gt;
                      &lt;div class='letter_section'&gt;
                          &lt;h1&gt;Service Agreement&lt;/h1&gt;
  
                          &lt;p style=
                          'color: #5d605f; font-family: arial; font-size: 20px; margin: 40px 0;'&gt;
                          December 30,2013&lt;/p&gt;
  
                          &lt;h3 class='address'&gt;Ms.jenifer Carter&lt;/h3&gt;
  
                          &lt;h3 class='address'&gt;Ms.jenifer Carter&lt;/h3&gt;
  
                          &lt;h3 class='address'&gt;Ms.jenifer Carter&lt;/h3&gt;
  
                          &lt;h3 class='address'&gt;Ms.jenifer Carter&lt;/h3&gt;
  
                          &lt;h3 class='address'&gt;Ms.jenifer Carter&lt;/h3&gt;
                      &lt;/div&gt;
                  &lt;/td&gt;
  
                  &lt;td&gt;&amp;nbsp;&lt;/td&gt;
              &lt;/tr&gt;
  
              &lt;tr&gt;
                  &lt;td style='background:red'&gt;&amp;nbsp;&lt;/td&gt;
  
                  &lt;td colspan='2'&gt;
                      &lt;p&gt;lorem ipum is the dolor sit amet lorem ipum is the dolor
                      sit amet lorem ipum is the dolor sit ametlorem ipum is the
                      dolor sit ametlorem ipum is the dolor sit amet lorem ipum
                      is the dolor sit amet lorem ipum is the dolor sit amet&lt;/p&gt;
  
                      &lt;p&gt;lorem ipum is the dolor sit amet lorem ipum is the dolor
                      sit amet lorem ipum is the dolor sit ametlorem ipum is the
                      dolor sit ametlorem ipum is the dolor sit amet lorem ipum
                      is the dolor sit ametlorem ipum is the dolor sit amet lorem
                      ipum is the dolor sit amet lorem ipum is the dolor sit
                      ametlorem ipum is the dolor sit ametlorem ipum is the dolor
                      sit amet lorem ipum is the dolor sit amet&lt;/p&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
          &lt;/tbody&gt;
      &lt;/table&gt;
  </code></pre>
  
  <p><strong>Reqired Output:</strong></p>
  
  <p><img src="https://i.stack.imgur.com/AcXwy.png" alt="enter image description here"></p>