Saving PPTX to stream in java

Are there any examples available to save Aspose Slides PPTX as stream in JAVA, I see the old links aren’t functional anymore.

@raj793,

I suggest you to please try using following sample code.

  Presentation pres=new Presentation("test.pptx");
  File file = new File(path+"Generated-Presentation-table" + ".pptx");
  pres.save(new FileOutputStream(file), SaveFormat.Pptx);

Hi @mudassir.fayyaz

I have a Presentation(OBJ) which i want to save as a stream to return as a Http response and not as a file.

@raj793,

I have observed your comments. I like to inform that you can save as ByteArrayOutputStream then you don’t need a File to store the presentation.

ByteArrayOutputStream baos = new ByteArrayOutputStream();
 Presentation pres=new Presentation("test.pptx");
 pres.save(baos, SaveFormat.Pptx);