Skip to main content

ResizeMode Enum

Lists resize modes.

Declaration

public enum ResizeMode extends Enum<ResizeMode> implements IIntEnum

Members

Name Description
CENTER

Centers content on the resized slide.

ENSURE_FILL

Scales content to fill the resized slide.

ENSURE_FIT

Scales content to fit within the resized slide.

STRETCH

Stretches content to fill the resized slide.

fromValue(int value)

Returns the enum item with the specified integer value.

getName()

Returns the enum item name.

getValue()

Returns the integer value.

toString()

Returns the string representation.

valueOf(String name)

Returns the enum constant with the specified name.

values()

Returns available constants.

Remarks

Use the Presentation.resizeSlides(newSize, mode) method to resize all slides in a presentation to the specified size. The mode parameter specifies how to resize the slide content.

The following example resizes slides to 640 × 360 and scales the content to fit within the new slide boundaries:

package presentation;

import com.devexpress.docs.presentation.*;

import java.io.FileOutputStream;
import java.nio.file.*;

public class Main {
    public static void main(String[] args) throws Exception {
        try(Presentation presentation =
                    new Presentation(Files.readAllBytes(Path.of("Presentation.pptx")))) {

            presentation.resizeSlides(new SlideSize(640, 360), ResizeMode.ENSURE_FIT);

            Path outputDir = Path.of("output");
            Files.createDirectories(outputDir);

            try (FileOutputStream fileStream = new FileOutputStream(
                    outputDir.resolve("PresentationResized.pptx").toFile())) {

                presentation.saveDocument(fileStream);
            }
        }
    }
}

Refer to the following help topic for additional information: Slide Size and Orientation — Presentation API for Java.

Implements

com.devexpress.java.enums.IIntEnum

Inherited Members

java.lang.Enum.<T>valueOf(java.lang.Class<T>,java.lang.String)
java.lang.Enum.clone()
java.lang.Enum.compareTo(E)
java.lang.Enum.describeConstable()
java.lang.Enum.equals(java.lang.Object)
java.lang.Enum.finalize()
java.lang.Enum.getDeclaringClass()
java.lang.Enum.hashCode()
java.lang.Enum.name()
java.lang.Enum.ordinal()
java.lang.Enum.toString()
java.lang.Object.getClass()
java.lang.Object.notify()
java.lang.Object.notifyAll()
java.lang.Object.wait()
java.lang.Object.wait(long)
java.lang.Object.wait(long,int)

Inheritance

Object
java.lang.Enum
ResizeMode