GroupDocs.Merger for Node.js via Java

Page orientation for EPUB files

GroupDocs.Merger for Node.js via Java adds smart features to Node.js apps. Developers can improve their tools by handling popular formats and setting EPUB page orientations.

How to set EPUB page orientation

Use GroupDocs.Merger to modify EPUB page layouts. This and other tools bring strong document handling to Node.js via Java apps.

  1. Provide the EPUB file path.
  2. Choose the page to work on.
  3. Switch its orientation.
  4. Save the output.
const mergerLib = require('@groupdocs/groupdocs.merger')

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

// Select the page to adjust
const mode = groupdocs.merger.OrientationMode.Landscape
const orientationOptions = new groupdocs.merger.OrientationOptions(mode, 1, 1)

// Pick the orientation you want
merger.changeOrientation(orientationOptions)

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

Dynamic document control

GroupDocs.Merger for Node.js via Java provides a solid toolkit for managing content across 50+ file formats with quick and dependable results.

GroupDocs.Merger tools

Join different file formats

Link up PDFs, Word files, presentations, spreadsheets, Visio diagrams, images, and archives. Adjust settings for a perfect fit.

Rearrange document pages

Move, swap, or drop pages to shape your document flow.

Tune page orientation

Rotate pages to an angle or toggle between portrait and landscape views.

Save pages as new files

Select pages and export them as a standalone file to any spot.

Flip the last page in a EPUB file

Find out how to tally pages in a EPUB document and adjust the last page’s layout.

JavaScript

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

// Open the file in the constructor
const merger = new mergerLib.Merger("document.epub");

// Get the page count
const info = merger.getDocumentInfo()
const lastPage = info.getPageCount()

// Choose the page and set portrait or landscape
const mode = groupdocs.merger.OrientationMode.Landscape
const orientationOptions = new groupdocs.merger.OrientationOptions(mode, lastPage, lastPage)

// Update the orientation
merger.changeOrientation(orientationOptions)

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

GroupDocs.Merger Overview

GroupDocs.Merger for Node.js via Java tackles document management for 50+ formats like PDF, Word, Excel, PowerPoint, Visio, images, and archives. Merge, split, extract, reorder, swap, delete, or adjust page layouts with ease.
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.

Main features

Discover tools to power up your solutions.

Adjust orientation for multiple formats

GroupDocs.Merger supports over 50 file types, letting you refine documents with a broad set of options.

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