var datas = [{"ticket_no": "1", "details": "detail1"}]; instance.get (somepath
, {params: ({data: JSON .stringify (datas),}), responseType: 'blob', Accept: 'application / pdf',}). then ((response) = > {const file = new Blob ([response.data], {type: 'application / pdf'}); const fileURL = URL.createObjectURL (file); // Открыть URL-адрес в новом окне window.open (fileURL);
}).catch((error) => {
console.log(error)
}).finally(() => {
})
// Контроллер
$pdf = PDF::loadView('PDF.pdf_irregularity',['data' => json_decode($request->data)])->setPaper('A5', 'landscape');
$fileName = 'Irregulairty';
return $pdf->output();