php - Rendering html to pdf -


i new laravel. want convert html page pdf therefore using:

https://github.com/barryvdh/laravel-snappy

now controller using following code:

$data = $this->getdata(); $html = view('myview', [ 'data' => $data] )->render();  $pdf = \app::make('snappy.pdf.wrapper'); $pdf->loadhtml($html); return $pdf->inline(); 

when dump or return $html variable, it's giving desire view on browser when convert not giving output. html page using bootstrap think after rendering normal html string. can tell missing here?

i have tried $pdf->loadview() it's not working.

take @ loadview function.

try this:

$data = $this->getdata();  $pdf = \app::make('snappy.pdf.wrapper'); $pdf->loadview('my.view', $data); return $pdf->inline(); 

and print what's returned laodview see if view correctly.


Comments

Popular posts from this blog

gridview - Yii2 DataPorivider $totalSum for a column -

java - Suppress Jboss version details from HTTP error response -

Sass watch command compiles .scss files before full sftp upload -