GroupDocs.Merger for Java

Page orientation control in EPUB

GroupDocs.Merger for Java equips Java apps with handy tools. Developers can enhance their projects by managing popular file formats and tweaking EPUB page orientation.

How to change EPUB pages orientation

Use GroupDocs.Merger to adjust EPUB page orientation. This feature, along with others, brings solid document management to Java projects.

  1. Point to the EPUB source file.
  2. Select the page number to adjust.
  3. Update the page orientation.
  4. Save the changes.
// Load source file path into Merger
Merger merger = new Merger("document.epub");

// Pick the page to change orientation for
OrientationMode mode = OrientationMode.Landscape;
OrientationOptions orientationOptions 
        = new OrientationOptions(mode, new int[] { 1 });

// Set the page orientation as needed
merger.changeOrientation(orientationOptions);

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

Flexible document content management

GroupDocs.Merger for Java offers a full set of tools to handle content in over 50 popular file formats with smooth, efficient processing.

GroupDocs.Merger features

Merge various file formats

Combine PDFs, Word files, slides, spreadsheets, Visio diagrams, images, and archives. Customize the process for the best outcome.

Manage document pages

Rearrange pages by moving, swapping, or deleting them to organize your content better.

Control page layout

Rotate pages to a set angle or switch between portrait and landscape modes.

Extract pages as separate files

Pick a page or a range of pages and save them as a new file wherever you want.

Change orientation of the last page in EPUB doc

Learn how to count pages in a EPUB file and change the last one’s orientation.

Java

// Load the source file into the constructor
Merger merger = new Merger("document.epub");

// Get the total page count
IDocumentInfo info = merger.getDocumentInfo();
int lastPage = info.PageCount;

// Set the page number and choose portrait or landscape
OrientationMode mode = OrientationMode.Landscape;
OrientationOptions orientationOptions = new OrientationOptions(mode, lastPage, lastPage);

// Apply the new orientation
merger.changeOrientation(orientationOptions);

// Save the updated file to an output path
merger.save("result.epub");
Maven XML
click to copy
copied
More examples Documentation

GroupDocs.Merger Overview

GroupDocs.Merger for Java is a tool for managing documents in over 50 formats, like PDF, Word, Excel, PowerPoint, Visio, images, and archives. It lets you merge, split, extract, move, swap, delete, or rotate pages. Add robust document control to your apps.
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

Check out the features that can boost your projects.

Change page orientation for many formats

GroupDocs.Merger works with over 50 file formats, making it easy to tweak documents with a variety of operations.

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