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.
Asked
Active
Viewed 891 times
1 Answers
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());
}
}
}

kiwiwings
- 3,386
- 1
- 21
- 57