如何使用php mpdf库将多个PDF文件合并为一个PDF
我的目标是将多个文件合并成单个pdf文件。为此,我从数据库中获取多个文件,使用不同的文件格式。从中,所有JPG/PNG文件都添加到html页面中,并转换为单个pdf文件如何使用php mpdf库将多个PDF文件合并为一个PDF,php,jquery,codeigniter-3,mpdf,Php,Jquery,Codeigniter 3,Mpdf,我的目标是将多个文件合并成单个pdf文件。为此,我从数据库中获取多个文件,使用不同的文件格式。从中,所有JPG/PNG文件都添加到html页面中,并转换为单个pdf文件 $dat='<html> <head> <title>Title of the document</title> </head> <body> <img src=&
$dat='<html>
<head>
<title>Title of the document</title>
</head>
<body>
<img src="/uploads/file_name1.PNG" width="100%" >
<img src="/uploads/file_name2.PNG" width="100%" >
</body>
</html>';
$header_data = array('header'=>'','footer'=>'');
$this->load->library('mpdf');
$mpdf = new mPDF('c','A4',10, 'Arial',10,10,10,10,0,0);
$mpdf->useAdobeCJK = true;
//$mpdf->SetAutoFont(AUTOFONT_ALL);
$data['cmp_id']=1;
$header_data = array('header'=>'','footer'=>'');
$mpdf->SetHTMLHeader(array('h'=>'35','html'=>$header_data['header'],'',''));
$mpdf->SetHTMLFooter(array('h'=>'25','html'=>$header_data['footer'],'',''));
$mpdf->SetTitle($candidate_name);
$mpdf->WriteHTML($dat);
$mpdf->Output('forms.pdf','I');
$dat='
文件标题
';
$header\u data=array('header'=>'','footer'=>'');
$this->load->library('mpdf');
$mpdf=新的mpdf('c','A4',10','Arial',10,10,10,0,0);
$mpdf->useAdobeCJK=true;
//$mpdf->SetAutoFont(AUTOFONT\u ALL);
$data['cmp_id']=1;
$header\u data=array('header'=>'','footer'=>'');
$mpdf->SetHTMLHeader(数组('h'=>'35','html'=>$header\u data['header'],'');
$mpdf->SetHTMLFooter(数组('h'=>'25','html'=>$header\u data['footer'],'');
$mpdf->SetTitle($candidate_name);
$mpdf->WriteHTML($dat);
$mpdf->输出('forms.pdf','I');
现在我需要合并这个pdf文件和使用mpdf库从数据库中获取的其他pdf文件
否则,包括pdf在内的所有文件都需要采用html格式,从中我可以使用生成的pdf文件。当我在html中添加pdf文件(使用iframe)时,它将不起作用。
请帮我解决这个问题。我不知道如何使用mpdf,但我在Linux上的生产中完成了所有这些,在质量、大小和时间方面都取得了优异的效果: