简体   繁体   中英

I use TCPDF how can i print by using livewire

$pdf = new PDF();
$view = View::make('Cards.export_card');
$html_content = $view->render();
$pdf::SetTitle('Patient Lists');
$pdf::SetAuthor('SmartTB');
$pdf::SetFont('helvetica', '', 10);
$pdf::SetFontSize('10px');
$pdf::SetY(-15);
$pdf::SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
$pdf::SetMargins(10, 18, 8);
$pdf::AddPage('L', 'A4');
$pdf::PageNo();
$pdf::writeHTML($html_content, true, false, true, false, '');
$pdf::Output('tb_patient_list_'.time().'.pdf', 'D');

Hi check Livewire file downloads https://laravel-livewire.com/docs/2.x/file-downloads

return response()->streamDownload(function () {
    echo 'CSV Contents...';
}, 'export.csv');

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM