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

Free Support Forum - aspose.com

Output Stream issues

Hi ,

I am trying to save PDF file in output stream.
ByteArrayOutputStream baos = new ByteArrayOutputStream ();
//some path is set into stream
//pdf is generated
//pdf is saved
pdf.save(baos );

Just wanted to know pdf.save closes the output stream automatically or I need to close it manually.


Hi Ankit,

Thanks for using our products.

As you are saving the PDF file in ByteArrayOutputStream, so Aspose.Pdf for Java will not close the Stream object and you will have to close it my your self. However it releases the Pdf object.