We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Is there any way to open PowerPointShow(.pps) file automatically?

Hi All,

Iam trying to convert x.ppt to x.pps and open x.pps automatically.

Is there any way to do that ?.... It is very urgent for me. Please help

Thanks in Advance,

Mohans

Hello Mohans,

Just rename .ppt to .pps. Formats are identical.

Hi Alexey Zhilin

I have created the new presentation as x.pps and manually i can open that.

But what iam trying is...after creating the x.pps, i need to run (open) that x.pps files automatically through java code.

upto some extend iam successfully achieved with the following code.

But here iam using hardcoded values...whcih i don't want.

If you guys has any idea to do that, please help me in this

here is my code:

FileInputStream fis = new FileInputStream(inputFile);

Presentation srcPres = new Presentation(fis);

Presentation newPres = new Presentation();

Point size = new Point(5760,4320);

//newPres.setSlideSize(size);

System.out.println("SLIDE Size ==="+size);

int srcPresLastSlidePosition = srcPres.getSlides().getLastSlidePosition();

TreeMap map = new TreeMap();

for (int iSlidesCounter = 1; iSlidesCounter <= srcPresLastSlidePosition; iSlidesCounter++) {

com.aspose.slides.Slide srcSld = srcPres.getSlideByPosition( iSlidesCounter );

srcPres.cloneSlide(srcSld, newPres.getSlides().getLastSlidePosition()+1 , newPres, map);

}

newPres.getSlides().remove(newPres.getSlideByPosition(1));

FileOutputStream fos = new FileOutputStream(outputPath + "NewPresenation.pps");

newPres.write(fos);

fos.close();

Runtime run = Runtime.getRuntime();

String cmd[] = new String[2];

cmd[0] = "C:\\Program Files\\Microsoft Office\\OFFICE11\\PPTVIEW.EXE";

//TODO: iam worrying about the above line. how to refer the pptview.exe dynamically and pass to the run.exec(cmd)

cmd[1] = "D:\\output\\NewPresenation.pps"; // This line is fine i can the path dynamically

Process pp = run.exec(cmd);

int exitValue = pp.waitFor();

System.out.println("exitValue :"+exitValue);

Thanks,

Mohans

Hello Mohans,

Please use java reference or google to find such information because it doesn’t have any relations with Aspose.Slides.

Runtime run = Runtime.getRuntime();
String cmd[] = { “cmd”, “/c”, “start”, “c:/a.pps” };
try {
Process pp = run.exec(cmd);
int exitValue = pp.waitFor();
} catch (Exception e) {
}