PHP での PDF ファイルの結合
Contents
[
Hide
]
Aspose.PDF - PDF ファイルの結合
Aspose.PDF Java for PHP を使用して PDF ファイルを結合するには、ConcatenatePdfFiles クラスを呼び出してください。
PHPコード
# Open the target document
$pdf1 = new Document($dataDir . 'input1.pdf');
# Open the source document
$pdf2 = new Document($dataDir . 'input2.pdf');
# Add the pages of the source document to the target document
$pdf1->getPages()->add($pdf2->getPages());
# Save the concatenated output file (the target document)
$pdf1->save($dataDir . "Concatenate_output.pdf");
print "New document has been saved, please check the output file" . PHP_EOL;
実行コードをダウンロード
以下に記載されたソーシャルコーディングサイトのいずれかから Concatenate PDF Files (Aspose.PDF) をダウンロードしてください。