0

Inside the laravel controller, When I do this

$html = '<h1><a name="top"></a>mPDF</h1>
        <h2>Basic HTML Example</h2>
        This file demonstrates most of the HTML elements.
        <h3>Heading 3</h3>
        <h4>Heading 4</h4>
        <h5>Heading 5</h5>
        <h6>Heading 6</h6>';

$pdf = App::make('dompdf');
$pdf->loadHTML($html);
$pdf->save('my_stored_invoice.pdf')

It works perfectly.

But when i do this

$pdf = App::make('dompdf');
$pdf->loadView('pdf.invoice');
$pdf->save('my_stored_invoice.pdf');

My browser crashes with the calling URL, Also apache got slowed down.

I have set INI limit 2048 MB.

Please suggest me some way to get out of this problem. Thanks in advance.

Pradeep
  • 9,667
  • 13
  • 27
  • 34

2 Answers2

0

Isnt really an answer but too big to fit in comments... Few things to try:

Check installed:

PHP version 5.3.0 or higher
DOM extension
GD extension
MBString extension
php-font-lib
php-svg-lib

Writeable folders - check to make sure that you are able to write any temporary files.

Check your logs to see what crashed?

Check top / htop / activity monitor etc to see if you are using all your ram

Gravy
  • 12,264
  • 26
  • 124
  • 193
0

Hello for this is fixed by changing the file permission

/vendor/thujohn/pdf

To allow domPDF to write temporally data

Ruberandinda Patience
  • 3,435
  • 3
  • 20
  • 18