Merge PDF in Java
Use Aspose.Slides for Java to merge PDF files in Java applications.
Merge PDF to PDF using Aspose.Slides
Aspose.Slides for Java
is a Java API for creating, editing, converting, and merging presentation content. You can place PDF files into a Presentation and import multiple PDF files and save them as one PDF file.
Merge PDF to PDF in Java
Using
Aspose.Slides for Java
, you can merge PDF files and create a PDF result with a few lines of Java code.
Java code for merging PDF to PDF
Presentation 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 Java
Install Aspose.Slides for Java .
Add the library as a reference in your project.
Create a
Presentationinstance.Import the source
PDFfiles withaddFromPdf.Save the merged content with
SaveFormat.Pdf.
Merge Files Online
Merge presentations and slides online.
Merge other files
You can also combine files in other formats to get a single file.