entityProcessor = $entityProcessor; } public function print(Template $template, Collection $collection, Data $data): Contents { $pdf = new Tcpdf(); $pdf->setUseGroupNumbers(true); foreach ($collection as $entity) { $pdf->startPageGroup(); $this->entityProcessor->process($pdf, $template, $entity, $data); } return new TcpdfContents($pdf); } }