Merge PDF
GroupDocs.Merger allows you to merge PDF files when it’s needed to organize multiple PDFs 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.
Supported PDF format versions are 1.2, 1.3, 1.4, 1.5, 1.6 and 1.7.
GroupDocs.Merger API provides several overloads of Join method to combine additional files with the source document loaded into Merger object.
- Join(String) - allows to merge document provided via file path on a local disk;
- Join(Stream) - provides an ability to combine documents loaded from any source - memory stream, remote URL etc.;
- Join(String, IJoinOptions) - is used for merging specific pages for document stored at local disk;
- Join(Stream, IJoinOptions) - used for merging specific pages from document provided as a stream.
The following example demonstrates how to merge PDF files with several lines of code:
using (Merger merger = new Merger(@"c:\document1.pdf"))
{
merger.Join(@"c:\document2.pdf");
merger.Save(@"c:\merged.pdf");
}
More resources
Advanced Usage Topics
To learn more about document merging features, please refer the advanced usage section.
GitHub Examples
You may easily run the code above and see the feature in action in our GitHub examples:
- GroupDocs.Merger for .NET examples, plugins and showcase
- GroupDocs.Merger for Java examples, plugins and showcase
Free Online App
Along with full featured .NET library we provide simple, but powerful free Apps.
You are welcome to merge your documents with our free online GroupDocs Merger App.