2

I am trying to working with DomPDF where I wanted to print some data.But the problem is inline CSS not working on that.Means it can't render the inline CSS though it works perfectly in HTML view How can I make it work. Any possible suggestion please ?

Here is my blade page to convert PDF

<!DOCTYPE html>
    <html>
    <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
      <title></title>
    </head>
    <body>  
      <div class="main">
        <h3 style="text-align:center"><u>X-Ray Invoice</u></h3>
        <p><strong>Box Number:</strong> {{$customer->box_number}}</p><br>
        <p style="float:right; margin-top: -38px;margin-right: 230px;"><strong>Custromer ID:</strong> {{$customer->uniqueId}}</p><br>
       </div>
    </body>
    </html>

Here is the controller code :

$pdf = PDF::loadView('pdf.test', compact('customer'));
return $pdf->download('inovice.pdf');

And here is the output

enter image description here

Sagar Gautam
  • 9,049
  • 6
  • 53
  • 84
User57
  • 2,453
  • 14
  • 36
  • 72
  • Possible duplicate of [CSS not working with DOMPDF](https://stackoverflow.com/questions/18008637/css-not-working-with-dompdf) – Sagar Gautam Jul 10 '17 at 04:31
  • Visit the above suggested question to get proper suggestion regarding your question. – always-a-learner Jul 10 '17 at 04:34
  • the link you provided isn't relevant to my Question. The person who have posted had Typo Error ..and then that was internal css problem may be..not inline one – User57 Jul 10 '17 at 04:52
  • Is the output you're showing the expected or what is produced by Dompdf? Be sure to tell us what you expect as well as what you see. From what I can tell Dompdf is doing what you're telling it. Remember that a standard document is ~600pt wide (that's 600px if the Dompdf DPI is at the default of 72). – BrianS Aug 15 '17 at 23:17

0 Answers0