I have a method that collects a series of records and sends them to a view, to be exported to pdf, I use Laravel and dompdf
/**
* @param Request $request
* @param $id
* @return mixed
*/
public static function pdfExport(Request $request, $id)
{
$day = $request->get('day');
...
$group_arr = [];
$pdf = PDF::loadView('front.cars.pdfExport', compact('group_arr'));
return $pdf->download('cars.pdf');
}
And then the view looks like this
<style>
.table{width:100%;margin-bottom:1rem;color:#212529}
</style>
<table>
<tr>
<td bgcolor="#415981">
<img id="definition-image" width="50%" height="50%" src=""><br>
</td>
</tr>
<tr>
<td>TEST PDF
</td>
</tr>
</table>
This code works for me on my local machine and on my server if I make the call through http: //, instead if I do it through https: //
I get an error from chrome saying "ERROR: NETWORK ERROR"
from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2F32MD8
via IFTTT
Aucun commentaire:
Enregistrer un commentaire