GroupDocs.Merger at a glance

API to combine, split, swap, trim, or remove documents, slides, and diagrams in .NET applications.

Illustration merger

Effortlessly merge multiple documents in C#

Easily combine multiple PDF and Office files into a single document using GroupDocs.Merger for .NET. With support for a wide range of formats, merging documents becomes quick and straightforward.

Simplify document management by splitting large files

Break down large PDF or Office files into smaller, more manageable sections. GroupDocs.Merger for .NET allows you to split documents by specific pages, ranges, or extract individual pages with ease.

Manipulate pages and customize document structure - reorder, swap, or remove

Gain full control over your documents by reordering, swapping, or removing pages. GroupDocs.Merger for .NET provides the flexibility to customize your document structure to meet your specific requirements.

Platform independence

GroupDocs.Merger for .NET is built to operate smoothly across multiple operating systems, frameworks, and package managers, providing versatility and compatibility for your development environment.

Amazon
Docker
Azure
VS Code
ReSharper
macOS
Linux
NuGet

Supported file formats

GroupDocs.Merger for .NET allows you to work with a variety of file formats, ensuring flexibility for your document processing needs.

Microsoft Office formats

  • Word: DOC, DOCX, DOCM, DOT, DOTX, DOTM, RTF, TXT
  • Excel: XLS, XLSX, XLSM, XLSB, XLTM, XLTX, XLT, XLAM
  • PowerPoint: PPT, PPTX, PPS, PPSX, ODP, OTP
  • Visio: VSDX, VSDM, VSSX, VSTX, VSTM, VSSM, VSX, VTX, VDX

Documents & images

  • Documents: PDF, XPS, TEX
  • Images: BMP, JPEG, PNG, GIF, TIFF, SVG, PS
  • OpenDocument: ODT, OTT, ODS
  • eBook: EPUB

Other formats

  • Web: HTML, MHTML, MHT
  • Archives: ZIP, TAR, RAR, 7Z, BZ2, GZ
  • OneNote: ONE

GroupDocs.Merger features

Easily merge, split, and manage PDF and Office documents.

Feature icon

Merge files

Combine multiple documents into one, merging entire files or specific pages from different sources.

Feature icon

Split documents

Break a document into multiple smaller files for better organization and management.

Feature icon

Move pages

Reorder pages within a document by moving them to a new position.

Feature icon

Remove pages

Delete specific pages or multiple selected pages from a document.

Feature icon

Rotate pages

Rotate pages in a document by 90, 180, or 270 degrees as needed.

Feature icon

Swap pages

Switch the positions of two pages within a document for better arrangement.

Feature icon

Extract pages

Select and extract specific pages or page ranges to create a new document.

Feature icon

Change orientation

Adjust page orientation to portrait or landscape for selected or all pages.

Feature icon

Preview pages

Generate image previews of document pages to get a clear view of their content and layout.

Code samples

Examples of common GroupDocs.Merger operations in .NET

Merge specific pages from DOCX files into a single document

The Selective Page Merge feature allows you to extract and merge only the required pages from multiple DOCX files. Here’s how to perform selective page merging using C#:

How to merge DOCX files in C#

JoinOptions joinOptions = new JoinOptions(1, 4, RangeMode.OddPages);

// Load the source DOCX file
using (Merger merger = new Merger(@"c:\sample.docx", loadOptions))
{
  // Add another DOCX file to include specific pages
  merger.Join(@"c:\sample2.docx", joinOptions);
  
  // Merge selected pages and save the output
  merger.Save(@"c:\result.docx");
}

Split a PDF document into multiple files

Easily break a large PDF into multiple smaller files using the Split Document feature. This helps with extracting specific sections or organizing content more efficiently. You can split documents based on various criteria, such as page range, specific start and end pages, or odd/even page numbers.

How to split a document into multiple multi-page files

// Use GroupDocs.Merger API to split a PDF file
int[] splitPages = new int[] { 3, 6, 8 };

// Set up SplitOptions with the output file format
SplitOptions splitOptions = new SplitOptions(@"c:\result_{0}.{1}", splitPages, SplitMode.Interval);

// Create a Merger instance and load the PDF document
using (Merger merger = new Merger(@"c:\sample.pdf"))
{
  // Call the split method with SplitOptions to generate separate files
  merger.Split(splitOptions);
}  

Ready to get started?

Download GroupDocs.Merger for free or get a trial license for full access!

Useful resources

Explore documentation, code samples, and community support to enhance your experience.

Temporary license tips

1
Sign up with your work email.
Free mail services are not allowed.
2
Use Get a temporary license button on the second step.
 English