title: codeigniter convert html page into pdf and send mail using Html2pdf
body: <p>i have one issue with html2pdf library in doceigniter. i am trying to send view page as pdf in mail using Html2pdf library but i cant able to implement this library in codeigniter</p>
  
  <p>this is my controller code </p>
  
  <pre><code>$this-&gt;load-&gt;library('Html2pdf');
  
      //Set folder to save PDF to
      $this-&gt;Html2pdf-&gt;folder('./assets/');
  
      //Set the filename to save/download as
      $this-&gt;Html2pdf-&gt;filename('test.pdf');
  
      //Set the paper defaults
      $this-&gt;Html2pdf-&gt;paper('a4', 'portrait');
  
      $data = array(
          'title' =&gt; 'PDF Created',
          'message' =&gt; 'Hello World!'
      );
  
      //Load html view
      $this-&gt;Html2pdf-&gt;html($this-&gt;load-&gt;view('pdf', $data, true));
  
      if($this-&gt;Html2pdf-&gt;create('save')) {
          //PDF was successfully saved or downloaded
          // echo 'PDF saved';
      }
  </code></pre>
  
  <p>when i run this code i get this error</p>
  
  <blockquote>
    <p>A PHP Error was encountered
    Severity: Notice
    Message: Undefined property: Example::$Html2pdf
    Filename: controllers/Example.php
    Line Number: 15</p>
    
    <p>Fatal error: Call to a member function folder() on a non-object </p>
  </blockquote>
  
  <p>please help me for implement this library 
  thanks everyone </p>