Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

how to use dompdf in laravel

//run following command
composer require dompdf/dompdf

// reference the Dompdf namespace
use DompdfDompdf;

// instantiate and use the dompdf class
$dompdf = new Dompdf();
//pass html code to following function
$dompdf->loadHtml(<html>html</html>);

// (Optional) Setup the paper size and orientation
$dompdf->setPaper('A4', 'landscape');

// Render the HTML as PDF
$dompdf->render();

// Output the generated PDF to Browser
$dompdf->stream();
Source by github.com #
 
PREVIOUS NEXT
Tagged: #dompdf #laravel
ADD COMMENT
Topic
Name
4+5 =