1

In My Laravel Application, I using DOMPDF to generate pdf files. When i convert Portrait Invoices its working properly. When i convert Landscape Invoices Its Display following Error Maximum execution time of 30 seconds exceeded in Frame.php (line 0)

My Controller Code is :

return \PDF::loadView('pdf/invoice', compact('salesinvoiceData','companyData','salesitemsData'))->setPaper('a4', 'landscape')->setWarnings(false)->download($salesinvoiceData->id.'.pdf');
Karthik
  • 5,589
  • 18
  • 46
  • 78

2 Answers2

2

I think includes css & js is the cause of slow load when generating pdf.

This is my code before:

@extends('layouts.master')
@section('content')
test
@endsection

After remove @extends problem is fixed

test
1

You could increase the max execution time:

set_time_limit(300); // Extends to 5 minutes.

// Then return the PDF
return \PDF::loadView(/* ... */)->download($salesinvoiceData->id.'.pdf');;

See: Fatal error: Maximum execution time of 30 seconds exceeded for more information.

rap-2-h
  • 30,204
  • 37
  • 167
  • 263