GroupDocs.Merger for Node.js via Java

Swap PPTX pages

GroupDocs.Merger for Node.js via Java adds advanced document editing features to Node.js applications. Effortlessly reorder pages in PPTX files to improve structure and readability.

How to reorder PPTX pages

GroupDocs.Merger makes it easy to rearrange pages in PPTX documents, giving you full control over document organization. Integrate efficient document editing into your Node.js via Java applications.

  1. Specify the file path for the PPTX document.
  2. Select the pages to be swapped or reordered.
  3. Apply the appropriate method to modify the document.
  4. Save the updated document to the desired location.
const mergerLib = require('@groupdocs/groupdocs.merger')

// Load the document into Merger
const merger = new mergerLib.Merger("document.pptx")

// Define the pages to be swapped
const swapOptions = new groupdocs.merger.SwapOptions(1, 2)

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

// Save the updated file to a new location
merger.save("result.pptx")
npm i @groupdocs/groupdocs.merger
click to copy
copied
More examples Documentation

Powerful document management

GroupDocs.Merger for Node.js via Java offers a comprehensive set of tools to modify and organize documents in over 50 formats.

Key features of GroupDocs.Merger

Merge multiple document types

Combine PDFs, Word files, spreadsheets, presentations, images, and archive files. Customize the output to match your needs.

Rearrange document layout

Modify the structure of your documents by moving, swapping, or deleting pages to enhance organization.

Change page orientation

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

Extract specific pages

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

Swap the first and last pages in a PPTX file

This example shows how to swap pages in a PPTX file in just a few steps.

JavaScript

const mergerLib = require('@groupdocs/groupdocs.merger')

// Load the source document
const merger = new mergerLib.Merger("document.pptx")

// Retrieve the total number of pages
const info = merger.getDocumentInfo()
const lastPage = info.getPageCount()

// Define swap parameters using page numbers
const swapOptions = new groupdocs.merger.SwapOptions(1, lastPage)

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

// Save the modified document
merger.save("result.pptx")
npm i @groupdocs/groupdocs.merger
click to copy
copied
More examples Documentation

GroupDocs.Merger capabilities

GroupDocs.Merger for Node.js via Java is a versatile document processing library that supports over 50 file formats, including PDFs, Word documents, Excel spreadsheets, PowerPoint presentations, Visio diagrams, images, and archives. Use it to merge, split, extract, rearrange, swap, and delete pages across different 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 features

Explore the main functionalities of our document processing library.

Modify page order in multiple formats

GroupDocs.Merger supports over 50 file formats, allowing you to fine-tune document layouts effortlessly.

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