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#

Merge Documents: Seamlessly combine multiple PDF and Office files into a single document, with support for a wide range of formats. GroupDocs.Merger for .NET makes document merging fast and hassle-free.

Simplify document management by splitting large files

Split large PDF or Office files into smaller, more manageable parts with ease. GroupDocs.Merger for .NET enables you to split documents based on specific pages, ranges, or even extract individual pages effortlessly.

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

Take control of your documents by rearranging pages, removing unwanted pages, or adding new ones. GroupDocs.Merger for .NET empowers you to manipulate document structure, allowing you to customize and tailor your files according to your specific needs.

Platform independence

GroupDocs.Merger for .NET supports the following operating systems, frameworks and package managers

Amazon
Docker
Azure
VS Code
ReSharper
macOS
Linux
NuGet

Supported file formats

GroupDocs.Merger for .NET supports operations with the following file formats.

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

Seamlessly merge, split, and manipulate PDF and Office Documents

Feature icon

Merge files

Combine two or more documents into a single document, merging specific pages or page ranges from multiple source documents.

Feature icon

Split documents

Divide a source document into multiple resultant documents using the split operation.

Feature icon

Move pages

Reposition pages within a document using the MovePage feature.

Feature icon

Remove pages

Remove individual pages or a collection of specific page numbers from the source document.

Feature icon

Rotate pages

Rotate pages within a document by setting the rotation angle to 90, 180, or 270 degrees using the RotatePages operation.

Feature icon

Swap pages

Exchange the positions of two pages within the source document, creating a new document with swapped page positions.

Feature icon

Extract pages

Extract specific pages or page ranges from a source document, generating a new document containing only the selected pages.

Feature icon

Change orientation

Set the page orientation (portrait or landscape) for specific or all pages of the document using the ChangeOrientation operation.

Feature icon

Preview pages

Generate image representations of document pages to understand the content and structure better. Make previews of all or just specific pages.

Code samples

Some use cases of typical GroupDocs.Merger for .NET operations

Merge specific DOCX file pages into a single document

The Selective Page Merge feature allows you to extract and merge only the desired content from each file. Here’s an example of how to achieve 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 merge
  merger.Join(@"c:\sample2.docx", joinOptions);
  
  // Merge DOCX files and save result
  merger.Save(@"c:\result.docx");
}

Split PDF document into multiple files

Efficiently split a document into multiple files with the Split Document feature which simplifies the process of managing and extracting specific sections or pages from large documents. It allows you to divide documents into smaller parts based on various criteria - by page range, by start/end pages, by odd/even page numbers, etc.

How to split the document to several multi-page documents

// Split PDF file using GroupDocs.Merger API
int[] splitPages = new int[] { 3, 6, 8 };

// Initialize SplitOptions class with output files path format
SplitOptions splitOptions = new SplitOptions(@"c:\result_{0}.{1}", splitPages, SplitMode.Interval);

// Instantiate Merger with input PDF document
using (Merger merger = new Merger(@"c:\sample.pdf"))
{
  // Call split method and pass SplitOptions object to save resultant documents
  merger.Split(splitOptions);
}  
 English