Closed sandy0201 closed 8 years ago
You may want to post this query with the mpdf1 author... not sure if there is a direct way to do this.
Hello.
Is there a way to add contents to existing PDF file like mPDF do?
I used this function in mPDF, but I want to know if i can do merge with this yii2-mpdf.
private function merge_PDFs( $files, $path ){
$pdf = new mPDF('', '', 0, '', 15, 15, 6, 12, 9, 9, 'P');
$pdf->enableImports = true;
foreach( $files as $file ){
$pdf->SetImportUse();
$pagecount = $pdf->SetSourceFile($file);
for ($i=1; $i<=($pagecount); $i++) {
$pdf->AddPage();
$import_page = $pdf->ImportPage($i);
$pdf->UseTemplate($import_page);
}
}
$pdf_name = date('Y-m-d_His') . '.pdf';
$pdf_path = $path . $pdf_name;
//Make sure path exists
if (!file_exists($path)) {
mkdir($path, 0777);
}
$pdf->Output($pdf_path, 'F');
unset($pdf);
return $pdf_path;
}
Thank you.
Hi,
Is there a way to combine/merge several PDF/DOC/DOCX files into one PDF file and then render the PDF file for download? Or is there any possible way to integrate mpdf with pdftk?
Thank you. Kind regards.