在laravel 5.1中集成HTML2PDF

I am trying to integrate html2pdf library in laravel 5.1. But it is showing error like as follows Class 'App\Http\Controllers\HTML2PDF' not found and my controller code is as follows

require_once(dirname(__FILE__).'/libs/html2pdf/html2pdf.class.php');
$html2pdf = new HTML2PDF('P','A4','en',true,'UTF-8',array(0, 0, 0, 0));
$html2pdf->pdf->SetDisplayMode('fullpage');
$html2pdf->WriteHTML($html22);

my folder path is app/Http/Controllers/libs/html2pdf/html2pdf.class.php

i had given the correct path but still it is showing error like HTML2PDF not found. Please anyone let me know how to integrate html2pdf ? or should i do any changes in compose.json file ?

and even i included the line App\Http\Controllers\HTML2PDF at the top of the Controller page but no use.

please help me out .

Thanks

I just downloaded the latest and it would seem there is no namespace.

Remove the use App\Http\Controllers\HTML2PDF and try instantiating html2pdf like $html2pdf = new \HTML2PDF('P','A4','en',true,'UTF-8',array(0, 0, 0, 0));

You can use this Package: https://packagist.org/packages/ensepar/html2pdf

add this to your composer.json

"ensepar/html2pdf": "4.0.6"

and run composer update

after that, you can use it in your controller like so

// add this to the beginning of your controller under the namespace declaration
use HTML2PDF;

// after that, you can use the class like so
$html2pdf = new HTML2PDF('P','A4','de',false,'UTF-8');
$doc = "<page><h1>Hello World</h1></page>";
$html2pdf->setDefaultFont('Arial');
$html2pdf->writeHTML($doc,false);
$html2pdf->Output(base_path().'/storage/app/helloworld.pdf','F');