i stuck on a problem generating pdf files. I have a module, which gets multiple invoice numbers. As a result i have to generate a single invoice pdf file for each invoice and create a zip file with all pdf files.
Is there an alternative using the PDF Model?
MagentoSalesModelOrderPdfInvoice
I can only run this 1 time to get the first invoice, a second run is not possible. And i dont want all invoices in a single pdf file.
foreach($selected as $id) {
$invoice = $this->invoice->loadByIncrementId($id);
$pdf = $pdfInvoiceModel->getPdf([$invoice])->render();
$zip->addFromString($orderIncrementId.'_invoice.pdf', $pdf);
}
If soneone has a solution, this would be great.
Thank you in advance
Andreas