Merge PDF Files in PHP
Combine multiple PDF documents with Aspose.Slides for PHP via Java.
Merge PDF to PDF using Aspose.Slides
Aspose.Slides for PHP via Java
can import pages from multiple PDF documents into a single Presentation and export the combined slides as one PDF file.
Merge PDF to PDF in PHP
Create a Presentation, remove its default slide, import each PDF with addFromPdf, and save the combined content with SaveFormat::Pdf.
PHP code for merging PDF to PDF
$presentation = new Presentation();
try {
$presentation->getSlides()->removeAt(0);
$presentation->getSlides()->addFromPdf("document1.pdf");
$presentation->getSlides()->addFromPdf("document2.pdf");
$presentation->save("merged.pdf", SaveFormat::Pdf);
} finally {
$presentation->dispose();
}
How to merge PDF files in PHP
Follow these steps to merge multiple PDF files into one PDF in PHP.
Install Aspose.Slides for PHP via Java. See Installation .
Configure Aspose.Slides in your PHP project.
Create a
Presentationinstance and remove its default slide.Import each PDF file with
addFromPdf.Call
savewith the output file path andSaveFormat::Pdf.
Merge Other Files
You can also combine files in other supported formats.