title: how to generate pdf using blade view with tcpdf laravel 5?
body: <p>I'm trying to create a pdf using laravel 5 and <a href="https://github.com/elibyy/laravel-tcpdf" rel="noreferrer">https://github.com/elibyy/laravel-tcpdf</a></p>
  
  <p>i have a form of 20 pages writing in laravel blade when my client fill the form and click submit i want to generate pdf for him and save it</p>
  
  <p>i try to do it like this in my controller</p>
  
  <pre><code>public function createPDF()
  {
      $pdf = Input::get('pdf',null);
      $company = Input::get('company',null);
      $branch = Input::get('branch',null);
      $sub_branch = Input::get('sub_branch',null);
      $form_type = Input::get('form_type',null);
      $form_name = Input::get('form_name',null);
      $form_heb_name = Input::get('form_heb_name',null);
      $sig_path=FormsController::getSignature_file();
  
      $data=compact('company','branch','sub_branch','form_type','form_name','form_heb_name','sig_path');
      Input::flash();
      if ($pdf) 
          { 
              $pdf = new TCPDF();
              $pdf-&gt;SetPrintHeader(false);
              $pdf-&gt;SetPrintFooter(false);
              $pdf-&gt;AddPage();
              $pdf-&gt;writeHTML(view('forms.'.$company.'.'.$branch.'.'.$sub_branch.'.'.$form_type.'.'.$form_name, $data)-&gt;render());
              $filename = storage_path().'/forms_pdf/10006/26/4718326/'.$form_name.'.pdf';
              $pdf-&gt;output($filename, 'I');
              return redirect('forms');
          }
       return view('forms.'.$company.'.'.$branch.'.'.$sub_branch.'.'.$form_type.'.'.$form_name , $data);
  }
  </code></pre>
  
  <p>bat its not working it's create 2 pdf page with All fields on top of each other</p>
  
  <p>how to fix it? </p>
  
  <p><strong>In addition, I want to save the pdf in a way it can not be edited file how can i do it?</strong></p>
  
  <p>thanks.</p>