Merge PDF Files in PHP
Combine multiple PDF documents with Aspose.Slides for PHP via Java.
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();
}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.
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.
Built with Aspose.Slides
Merge PDF Files Online
The free Aspose.Slides Merger app is built with Aspose.Slides for PHP via Java, the same API as the code above. Open it and see what the API can do with your own PDF files.
- Runs in your browser, nothing to install.
- See how Aspose.Slides merges files before you write code.
- Upload several PDF files and combine them into one.
- Download the merged result as one file.
Merge Other Files
You can also combine files in other supported formats.