pdf-l4
pdf-l4 copied to clipboard
Crete PDF from HTML
Hi.
I have a list of users, and i can access to the information details in a web page, i need to generate the pdf file of the information details, so, how can i generate the pdf from the web page?
I already have the page with the style and the information i need
The route is:
Route::get('myusers/{id?}', 'UsersController@showUser');
Hi.
You can try this :
Route::get('pdf-from-view', function()
{
$data = array();
$html = View::make('my-view', $data);
return PDF::load($html, 'A4', 'portrait')->show();
});
Thanks for answer.
I build the data array with the id of the user
Route::get('myusers/{id?}', function(){
$data = array('as' => 'data, 'uses'
=> 'UsersController@showUser');
$html = View::make('myusers/{id?}', $data);
return PDF::load($html, 'A4', 'portrait')->show;
});
All i got is an exception that the route 'myusers' doesn't exist