Closed nwwheeler closed 3 years ago
Wie kann ich meine bestehende Instanz von FPDF (PDF) nutzen für den Output ?
If your replace your original FPDF
library with this namespaced version, then it should work.
Hello @sprain This fix sadly didn't work for me.
I'm also trying to output an extended class which doesn't work.
Fatal error: Uncaught TypeError: Argument 3 passed to Sprain\SwissQrBill\PaymentPart\Output\FpdfOutput\FpdfOutput::__construct() must be an instance of Fpdf\Fpdf, instance of INVOICE given
Thank you for your help and time.
@DonatoDeluxe
Please let us know what print get_class($yourFdpInstance);
puts out for you. Then we can help, maybe.
@DonatoDeluxe
Oh, I just realized you already provided the information: instance of INVOICE given
.
You must make sure you are injecting an FPDF instance. So it depends what your INVOICE
is based on.
@sprain Thank you for your reply. My INVOICE class extends FPDF class.
My INVOICE class extends FPDF class.
If what you have is
class INVOICE extends Fpdf\Fpdf { /* … your class */ }
and then you do
$invoice = new INVOICE(); // or whatever way ist needed to get an instance of your invoice class
$output = new QrBill\PaymentPart\Output\FpdfOutput\FpdfOutput($qrBill, 'en', $invoice);
it should be working.
Otherwise we need to see some code to reproduce the problem in order to be of any further help here.
Hello @sprain
Yes in short the code was like that. I fixed it now with the "jurosh/pdf-merge" library where i create each PDF separately and then merge them together.
Thank you for your time and help.
Hallo Ich benutze FPDF in einem Script schon zum Erstellen eines Rechnungs-PDF mit Header und Footer was problemlos funktioniert:
In demselben Script möchte ich nun noch eine neues PDF mit dem QR-Bill erstellen:
Bei diesem Versuch entsteht folgende Fehlermeldung:
Wie kann ich meine bestehende Instanz von FPDF (PDF) nutzen für den Output ?
Besten Dank für jede Hilfe.