elibyy / tcpdf-laravel

TCPDF helper for laravel
MIT License
315 stars 74 forks source link

None of the methods seem to work #121

Closed Marchiuzzz closed 2 years ago

Marchiuzzz commented 2 years ago

Hi, I'm not sure if I'm doing something wrong or am missing something but nothing I try works. More specifically, none of these work, I get Call to undefined method Elibyy\TCPDF\Facades\TCPDF::setPrintHeader()" etc. I'm using laravel 8, maybe that's why, although my PHP version is 7.3?

use PDF;
...
$pdf = new PDF();
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
$pdf->SetAutoPageBreak(true, 0);

It's as if I just have the tcpdf-laravel wrapper but not the actual TCPDF. Do I need to also require for TCPDF separately?

elibyy commented 2 years ago

Hey there, What do you get as output? Also, please note as per the Readme, you aren't suppose to instantiate PDF

Marchiuzzz commented 2 years ago

@elibyy You're right, I needed to use the methods statically, missed this important detail. It works now, thanks for fast reply!