title: How to generate pdf using Codeigniter?
body: <p>I have tried using dompdf. The following is controller in the Codeigniter</p>
  
  <pre><code>function get_pdf( )
  {
  $this-&gt;load-&gt;library('Pdf');
  $this-&gt;pdf-&gt;load_view('report.php' );
  $this-&gt;pdf-&gt;load_html('report.php','',true);
  $this-&gt;pdf-&gt;render();
  $this-&gt;pdf-&gt;stream("welcome.pdf");
  }
  </code></pre>
  
  <p>The data in report.php </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code> 
    $(document).ready(function(){ 
        
     
     
      
   $.ajax({
                  type: "POST",
                  url: $u+"get",
                  data: {
                    
                    role:"report",
                     },
  
                  datatype: "json",
                  crossDomain: true,
                  success: function(result) {
                     var result = $.parseJSON(result);
                       for (var result in syncx) {
  
                      $("#tta tbody").append("&lt;tr &gt;&lt;td class='cyan'&gt;"+x+"&lt;/td&gt;&lt;td&gt;"+syncx[x].total+ "&lt;/td&gt; &lt;/tr&gt;");
                            
                        }
                     
                         Morris.Line({
                  element: 'total-line',
                  data: source,
                  behaveLikeLine: true,
                 parseTime : false, 
                  xkey: 'x',
                  ykeys: [ 'totol'],
                  labels: [  'total'],
                  pointFillColors: ['#707f9b'],
                  pointStrokeColors: ['#ffaaab'],
                  lineColors: ['#f26c4f', '#00a651', '#00bff3'],
                  redraw: true 
              });
  
                  }
  }
                            });
  
    
   });
  
    
  
   
    
   
  &lt;body&gt;
     &lt;div class="row "&gt;
       
        
            &lt;div id="responsive" class=" "&gt;
          &lt;h4  &gt; Record&lt;/h4&gt;
          &lt;div class=" "&gt;
            &lt;div id="flip-scroll" class="card"&gt;
              &lt;p&gt; &lt;/p&gt;
              &lt;table id="tta"   &gt;
                &lt;thead&gt;
                  &lt;tr&gt;
                      &lt;th&gt;x&lt;/th&gt;
                      &lt;th&gt;Total &lt;/th&gt;
                    
                  &lt;/tr&gt;
                &lt;/thead&gt;
                &lt;tbody&gt; &lt;/tbody&gt;
              &lt;/table&gt;
            &lt;/div&gt;
          &lt;/div&gt;
  
        &lt;/div&gt;
  
       
         &lt;/div&gt;
  
        
      
      &lt;div class="col  "&gt;
        &lt;div class="card"&gt;
          &lt;div class="card-image"&gt;
            &lt;div  id="total-line"&gt;&lt;/div&gt;
            &lt;span class="card-title"&gt; &lt;/span&gt;
            
          &lt;/div&gt;
          &lt;div class="card-content"&gt;   &lt;p&gt;Total&lt;/p&gt;
      &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
   
   
    
  
  &lt;/body&gt;
   </code></pre>
  </div>
  </div>
  </p>
  
  <p>The pdf report is generated but only html data was there. The ajax and jquery data was missing. No graph was generated and table has no data.What should I do here to generate the complete report with graph and ajax data in the table complete. Here the view is fetched as it is but the data which is fetched from the ajax all is  missing. </p>
  
  <p>EDIT: Please suggest something else which can be suitable to achieve this.</p>