How to protect pdf generated from laravel MPDF

use PDF;

$pdf = PDF::loadview('mail.pdf', $data, [], [
'format' => 'Legal-L',
'margin_header' => 10,
'margin_footer' => 5,

]);
$pdf->getMpdf()->SetProtection(array(), 'UserPassword', 'MyPassword');

Related Post