GroupDocs.Merger allows developers to merge PDF files when it’s needed to organize multiple PDF files into single document or send fewer attachments etc. And you can do this without any third-party software or manual work involved. With GroupDocs.Merger it is possible to combine PDF documents of any size and structure - all text, images, tables, graphs, forms and other content will be preserved.
The following example demonstrates how to merge PDF files with several lines of Java code:
- Create an instance of Merger class and pass source PDF file path as a constructor parameter. You may specify absolute or relative file path as per your requirements.
- Add another PDF file to merge with join method. Repeat this step for other PDF documents you want to merge.
- Call Merger class save method and specify the filename for the merged PDF file as parameter.
// Load the source PDF file Merger merger = new Merger("c:\sample1.pdf") // Add another PDF file to merge merger.join("c:\sample2.pdf"); // Merge PDF files and save result merger.save("c:\merged.pdf");
Portable Document Format (PDF) is a type of document created by Adobe back in 1990s. The purpose of this file format was to introduce a standard for representation of documents and other reference material in a format that is independent of application software, hardware as well as Operating System. PDF files can be opened in Adobe Acrobat Reader/Writer as well in most modern browsers like Chrome, Safari, Firefox via extensions/plug-ins.
Please find more use-cases and complete Java sources of our backend and frontend examples and try them for free!
GroupDocs.Merger for Java provides an online PDF Merger App, which allows you to try it for free and check its quality and accuracy.
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.