Closed matiasah closed 6 years ago
Hey there,
if you are using the facade pattern you are not suppose to do new TCPDF()
but instead TCPDF::Output('boleta.pdf','I')
and so on
Please note that if you intend on generating more than one PDF you should use the reset
method
Hope this helps
I can't seem to be getting it either way.
That's odd. Can you please try and provide the following:
dd(get_class($this->tcpdf));
by temporarily adding it in D:\Git\GetFit\Backend\vendor\elibyy\tcpdf-laravel\src\TCPDF.php on line 38Also, The reset is only required at the end and only if you are in a loop, by default there's no need for it
That's the output, doesn't seem to be null.
Now, I renamed the 'TCPDF' alias to just 'PDF'. I don't know why, but it fixes the issue.
Yup, just figured it out too.
Apparently PHP allows you to override classes using class_alias
(which laravel uses internally for anything you specify in aliases array in config/app.php).
So my class TCPDFHelper extends \TCPDF
translates into class TCPDFHelper extends \Elibyy\TCPDF\Facades\TCPDF
that doesn't have the method AddPage
I'm having some issues with the library, I'm not sure if I'm doing anything wrong. It also throws errors when trying to use any other method; SetTitle, SetAuthor, AddPage, etc.