I am inside a laravel 5.7 application, using the package barryvdh / laravel-snappy and trying everything (this code is the last attempt), to generate a dynamically PDF that has at least 2,000 pages.
This code is about my last attempt inside the view.
\DB::table(\DB::raw('`n_f_blocks`'))
->join('n_f_files', 'n_f_files.id', '=', 'n_f_blocks.n_f_file_id')
->where('n_f_files.group_id', '=', $file->id)
->where('tipo', 'saida')->orderBy('n_f_blocks.id', 'asc')->chunk(1000, function($data) {
foreach($data as $nf) :
@endphp
<tr>
<th scope="row">{{ $nf->nota }}</th>
<td>{{ $nf->chave }}</td>
<td>{{ date("d/m/Y", strtotime($nf->data)) }}</td>
<td>{{ $nf->mod }}</td>
<td>{{ $nf->ser }}</td>
<td>{{ $nf->bc_pis_original }}</td>
<td>{{ $nf->bc_cofins_original }}</td>
<td>{{ $nf->pis_original }}</td>
<td>{{ $nf->cofins_original }}</td>
<td>{{ $nf->icms_original }}</td>
<td>{{ $nf->bc_pis_processado }}</td>
<td>{{ $nf->bc_cofins_processado }}</td>
<td>{{ $nf->pis_processado }}</td>
<td>{{ $nf->cofins_processado }}</td>
<td>{{ $nf->icms_processado }}</td>
</tr>
@php
endforeach;
});
@endphp
It is possible?
I already received several errors, timeout, max memory size ..
I really do not know how to solve.