Monday, March 6, 2017

Issue while trying to convert Html into PDF in Laravel

I am trying to create PDF from a Blade. My View has example same static Html as showing in this plunker link

My code is simple...using barryvdh/laravel-dompdf package...I am writing below code in controller action method

$pdf = \PDF::loadView('ViewPage', ["Data" => 123]);
return $pdf->download('sample.pdf');

Now, the problem is when i view it in html page...it works perfectly and we may check the correct expected output here: https://plnkr.co/edit/an7JsFSkNt52oKi0Oupg?p=preview ...but when I run above code to put the exact same html into PDF...it shows something like this

Am I missing anything?

enter image description here



via Helper

Advertisement