crabbly / fpdf-laravel

A package for Laravel to implement the FPDF class.
Other
30 stars 8 forks source link

Too few arguments to function #3

Open JN-Devsite opened 5 years ago

JN-Devsite commented 5 years ago

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();

wilca commented 3 years ago

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();