mercredi 1 novembre 2017

Error generating pdf from blade file in laravel 5

I am trying convert blade view to pdf. If i use normal text i am able to generate the pdf. I have few images in my blade template and with that i am not able to generate pdf.

Here is my blade template code.

<html>
<head>
  <link href="" rel="stylesheet">
</head>
<body>
  <div class="container">
    <div class="row col-md-12">
      <div class="col-md-5">
        <table>
          <tr>
            <td>ID</td>
            <td>:</td>
            <td>CO12345</td>
          </tr>
          <tr>
            <td>Date</td>
            <td>:</td>
            <td>CO12345</td>
          </tr>
          <tr>
            <td>Contract/PO #</td>
            <td>:</td>
            <td>C122</td>
          </tr>
          <tr>
            <td>Job ID</td>
            <td>:</td>
            <td>0001</td>
          </tr>
          <tr>
            <td>Client Name</td>
            <td>:</td>
            <td>Hong</td>
          </tr>
          <tr>
            <td>Project</td>
            <td>:</td>
            <td>Lake Nona Place</td>
          </tr>
          <tr>
            <td>Address</td>
            <td>:</td>
            <td>123 Roy street, Suit 107, Lake Nona, FL 32817</td>
          </tr>
        </table>
      </div>
      <div class="col-md-7">
        <img src="images/logo.jpg " class="float-right img-responsive img-thumbnail">
      </div>
    </div>
    <div class="my-auto mx-auto text-center">
      <h4>Change Order</h4>
    </div>
    <div class="row col-md-12">
      <table class="table table-bordered">
        <thead>
          <tr>
            <td><b><p class="text-md-center">Line</p></b></td>
            <td><b><p class="text-md-center">Title</p></b></td>
            <td><b><p class="text-md-center">Description</p></b></td>
            <td><b><p class="text-md-center">Total</p></b></td>
          </tr>
        </thead>
        <body>
          <tr>
            <td><p class="text-md-center">1</p></td>
            <td><p class="text-md-center">B12, Unit 114</p></td>
            <td><p class="text-md-center">Replace damage carpate in master bedroom.</p></td>
            <td><p class="text-md-center">$250</p></td>
          </tr>
          <tr>
            <td colspan="3"></td>
            <td><p class="text-md-center">$250</p></td>
          </tr>
        </body>
      </table>
    </div>
    <hr/>
    <div class="col-md-12 row">
      <div class="col-md-3">
        <img src="images/logo.jpg " class="float-right img-responsive img-thumbnail">
      </div>
      <div class="col-md-3">
        <img src="images/logo.jpg " class="float-right img-responsive img-thumbnail">
      </div>
      <div class="col-md-3">
        <img src="images/logo.jpg " class="float-right img-responsive img-thumbnail">
      </div>
      <div class="col-md-3">
        <img src="images/logo.jpg " class="float-right img-responsive img-thumbnail">
      </div>
    </div>
    <hr/>
    <div class="my-auto">
      <p>
        I hereby authorize <b>John</b> to perform the extra work listed above. I further state that I am authorized to
        approve this extra work and that my signature below serves as a payment commitment of such.
       </p>
    </div>
  </div>

   <script src="http://ift.tt/1XwG72U"></script>
   <script src=""></script>
</body>
<html>

Here is code snippet from controller class which generates pdf.

public function generatePdf(){
  $pdf = PDF::loadView('template1');
  return $pdf->download('template1.pdf');
}

I am using this http://ift.tt/TMipBv for pdf.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2ijHwJU
via IFTTT

Aucun commentaire:

Enregistrer un commentaire