GroupDocs.Merger for .NET

Move pages in PDF

GroupDocs.Merger for .NET enables .NET applications to easily reorder pages in PDF documents.

How to move PDF pages

GroupDocs.Merger makes it easy to move selected pages in PDF documents. Enhance your .NET applications with advanced document processing features.

  1. Provide the file path of the source PDF document.
  2. Specify the page number and its new position.
  3. Execute the page move operation.
  4. Save the updated document.
// Create a Merger instance with the source file
using (Merger merger = new Merger("document.pdf"))
{
    // Specify the page number to be moved
    int pageNum = 3;
    int moveTo = 1;
    MoveOptions moveOptions = new MoveOptions(pageNum, moveTo);

    // Move the page to the new position
    merger.MovePage(moveOptions);

    // Save the modified document
    merger.Save("result.pdf");
}
dotnet add package GroupDocs.Merger
click to copy
copied
More examples Documentation

Advanced document processing

GroupDocs.Merger for .NET offers a comprehensive set of features, allowing you to efficiently process over 50 widely used business file formats.

Key features of GroupDocs.Merger

Merge documents in various formats

Combine PDFs, Word documents, presentations, spreadsheets, images, archives, and more. Use flexible options to achieve the desired results.

Manage document pages

Rearrange pages within documents. Move, swap, or remove pages to better organize your content.

Adjust page layout

Rotate pages to any angle or switch between landscape and portrait orientation.

Extract pages into separate files

Select and extract specific pages, saving them as standalone documents.

Move a page to the end of the document

This example demonstrates how to move a specific page to the end of a PDF document.

C#

// Pass the source file path to the constructor
using (Merger merger = new Merger("document.pdf"))
{
    // Retrieve document details and the last page number
    IDocumentInfo info = merger.GetDocumentInfo();

    // Set up options with the page numbers
    int pageNum = 1;
    int moveTo = info.PageCount;
    MoveOptions moveOptions = new MoveOptions(pageNum, moveTo);

    // Move the page to the end of the document
    merger.MovePage(moveOptions);

    // Save the updated document to a new location
    merger.Save("result.pdf");
}
dotnet add package GroupDocs.Merger
click to copy
copied
More examples Documentation

About GroupDocs.Merger

GroupDocs.Merger for .NET is a powerful document processing tool that supports over 50 file formats, including PDF, Word, Excel, PowerPoint, images, and archives. It provides essential features such as merging, splitting, extracting, moving, swapping, and deleting pages.
Learn more
About illustration

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.

Key features

Explore additional powerful capabilities of our solution.

Reorder pages in multiple formats

GroupDocs.Merger supports over 50 file formats, making document manipulation flexible and efficient.

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