I'm developing an application in Laravel 5.0, from a view I make a petition to generate a PDF file and download, I'm using DomPDF, for that, I have a controller who manages everything related to the PDF, I have a function:
public function invoice()
{
$view = \View::make('invoice')->render();
$pdf = \App::make('dompdf.wrapper');
$pdf->loadHTML($view);
$pdf->download('invoice.pdf');
}
Then, in the view I made the request using AJAX, this is my code:
$("#dowload").click( function(){
$.ajax({
url: 'pdf',
type: "get",
data: {},
success: function(data){
window.location = 'pdf';
}
})
}
That is working with no errors, the thing is that it makes it very very slow, and there's no reason because the information displayed in the view invoice is static, nothing dynamic, no data processing, nothing and they're only 2 pages! So, I was checking and I noticed that the slow command is $pdf->download('invoice.pdf'); so, what should I check?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire