0
I have an app Laravel
that generates reports in PDF
according to parameters received from a form via POST and would like to view the files generated with the viewer.js
without having to save the files in directory and the function used to generate the PDF
is:
public function generateReport(Request $request){
$dataset = Report::where('idfilial', '=', $request->idfilial)
->whereBetween('datamovimento', [$request->datainicial, $data->datafinal])
->get();
$pdf = \App::make('dompdf.wrapper');
$pdf->loadHtml(view('report.pdf', compact('dataset')));
return $pdf->stream();
}
With this plugin no, it only accepts the path of a disk file, as explained in its instruction documentation
– novic
I’ve already found some examples using an Encode Base64, something like this: Viewer.html? file=data:application/pdf;Base64,Jvberi0xljqxxxxx
– Ismael M. de Sousa
Paste here the links of the examples!
– novic
because of the amount of characters, I added the example link to a Docs.google that you can access by this link: https://docs.google.com/document/d/1t01HuDEC01QulzTXw_jRqmoEA3C7M1LfLlv7b45f7f4/edit?usp=sharing
– Ismael M. de Sousa
A Base64 from Hello Word is one thing a large document will not support
– novic
However, if you open the example link that sends you and replace the Encode Base64 with the Encode Base64 of any other pdf it works. But if I do it the same way in my project it doesn’t work. So I think it’s just a matter of configuration, but I didn’t find anything in the documentation
– Ismael M. de Sousa