4

I am wondering if by any mean, i can set the 'Slide sized for ' as On-ScreenShow (16:9). i mean is there any method in master object in apache poi hslf? I couldn't find it. I have added the image for the reference.

enter image description here

1 Answer 1

4

You can only have one page size per file.

To set the page dimension call SlideShow.setPageSize().

To find out which page dimensions 4:3, 16:9 or any other formats are, just create a PPT manually via Powerpoint and check its dimension - or use a Cross-multiplication:

import java.io.File;
import java.io.IOException;

import org.apache.poi.sl.usermodel.SlideShow;
import org.apache.poi.sl.usermodel.SlideShowFactory;

public class SlideSizes {
    public static void main(String[] args) throws IOException {
        String files[] = { "dim_4_3.ppt", "dim_16_9.ppt" };
        for (String f : files) {
            SlideShow<?,?> ppt = SlideShowFactory.create(new File(f));
            System.out.println(ppt.getPageSize());
        }
    }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.