lara-pdf-merger
lara-pdf-merger copied to clipboard
Using merger twice
I want to use the merger twice in my controller. Because i have to merge different document in same time.
I initiate the package in different variabel. But i think that variable use same reference.
This is my code.
$pdf = PdfMerger::init(); $pdf->addPDF(Storage::disk('template')->path('1') . "/prev_tmp.pdf"); $pdf->merge(); $pdf2 = PdfMerger::init(); $pdf2->addPDF(Storage::disk('template')->path('2') . "/prev_tmp.pdf"); $pdf2->merge(); dd($pdf, $pdf2);