GroupDocs.Merger for Java

Swap PPTX pages

GroupDocs.Merger for Java enhances Java applications with flexible document manipulation features. Reorder pages in PPTX files to streamline content structure.

How to reorder PPTX pages

GroupDocs.Merger simplifies page reordering in PPTX documents, giving you full control over content organization. Integrate seamless document processing into your Java applications.

  1. Define the path to the PPTX file.
  2. Choose the pages to be swapped or reordered.
  3. Use the appropriate method to modify the document.
  4. Save the updated file to the preferred location.
// Load the document into Merger
Merger merger = new Merger("document.pptx");

// Specify the pages to be swapped
SwapOptions swapOptions = new SwapOptions(1, 2);

// Execute the swap operation
merger.swapPages(swapOptions);

// Save the modified file to a new location
merger.save("result.pptx");
Maven XML
click to copy
copied
More examples Documentation

Enhanced document processing

GroupDocs.Merger for Java provides a robust set of tools to efficiently manage and manipulate documents in over 50 formats.

Key features of GroupDocs.Merger

Merge multiple document formats

Combine PDFs, Word documents, spreadsheets, presentations, Visio files, images, and archives. Fine-tune the output with customization options.

Modify document layout

Rearrange content by swapping, reordering, or removing pages to improve document structure.

Change page orientation

Rotate pages to any angle or switch between portrait and landscape mode as needed.

Extract specific pages

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

Swap the first and last pages in a PPTX file

This example demonstrates how to swap pages in a PPTX file with just a few simple steps.

Java

// Load the original document
Merger merger = new Merger("document.pptx");

// Retrieve the total number of pages
IDocumentInfo info = merger.getDocumentInfo();
int lastPage = info.PageCount;

// Define swap settings with page numbers
SwapOptions swapOptions = new SwapOptions(1, lastPage);

// Execute the page swap operation
 merger.swapPages(swapOptions);

// Save the modified document
merger.save("result.pptx");
Maven XML
click to copy
copied
More examples Documentation

GroupDocs.Merger features

GroupDocs.Merger for Java is a powerful document processing library that supports 50+ file formats, including PDF, Word, Excel, PowerPoint, Visio, images, and archives. Integrate it into your applications to merge, split, extract, rearrange, swap, and remove pages from various document types.
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.

Core functionalities

Discover the essential features of our document processing library.

Reorder pages in various file types

GroupDocs.Merger supports more than 50 formats, enabling precise document modifications.

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