以下是php PDF合并命令。$fileArray= array("name1.pdf","name2.pdf","name3.pdf","name4.pdf");$datadir = "save_path/";$outputName = $datadir."merged.pdf";$cmd = "gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=$outputName ";//Add each pdf file to the end of the commandforeach($fileArray as $file) { $cmd .= $file." ";}$result = shell_exec($cmd);我忘记了找到它的链接,但是它工作正常。注意:您应该安装gs(在Linux上,可能在Mac上),或Ghostscript(在Windows上),以使其正常工作。