fpdf-laravel icon indicating copy to clipboard operation
fpdf-laravel copied to clipboard

Too few arguments to function

Open JN-Devsite opened this issue 6 years ago • 1 comments

Hi, I had received the error: Too few arguments to function Illuminate\Filesystem\FilesystemAdapter::put(), 1 passed in when trying your example in Laravel 5.7

I changed my code to this below for the output: -

$pdf->Output(); //save file exit();

This seemed to allow it to work

Thought I would also share this : -

I could declare it like this at the top of my controller class: -

use Crabbly\FPDF\FPDF;

Then used my code like this in my method: -

$pdf = new FPDF; // Use this to instantiate FPDF to create PDFs $pdf->AddPage(); // Create Page $pdf->SetFont('Arial','B',16); $pdf->Cell(40,10,'Hello World!'); $pdf->Output(); //save file exit();

JN-Devsite avatar Dec 12 '18 06:12 JN-Devsite

Hola, me generaba el mismo error de muy pocos argumentos al usar el ejemplo que esta de guia, utilice tu solucion $ pdf-> Ouput(); // guardar archivo exit (); con el exit(); por fin pudo mostrar bien el pdf.

asi es como lo deje, pero igual sirve tambien la tuya.

use Crabbly\Fpdf\Fpdf;

$pdf=app('Fpdf'); $pdf->AddPage(); $pdf->SetFont('Arial','B',16); $pdf->Cell(40,10,'Hello World!'); $pdf->Output(); exit();

wilca avatar Mar 10 '21 14:03 wilca