webman Response 返回PDF

suihua
use Dompdf\Dompdf;

public function dom(Request $request)
{
    // instantiate and use the dompdf class
    $dompdf = new Dompdf();
    $dompdf->loadHtml('hello world');

    // (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();
}

如上代码

页面 返回 ·null·

346 1 0
1个回答

10bang
×
🔝