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

Free Support Forum - aspose.com

Document initialization

Can I assign memory stream after initialization of document with document constructor without parameter?

var pdfDocument = new Document(memoryStream);

OR

var pdfDocument = new Document(filePath); 

I want it to be a singleton object so that I can assign different memory stream whenever I use it.

var pdfDocument = new Document();
pdfDocument._**propertyName**_ = memoryStream;

This Topic is created by codewarior using the Email to Topic plugin.

@sharanya_ps,

Thanks for contacting support.

In order to load the contents of input file to Document instance, we need to pass the MemoryStream as an object to Document instance. I am afraid later on no Stream instance can be assigned / associated with Document object. In case you need to assign different stream objects, you need to create a separate Document instance, load Steam object inside Document object and then perform further operations.

In case I have not properly understood your requirement or you have any further query, please feel free to contact.