Free Support Forum - aspose.com

How to find the SIZE of Document?

I want to store the Document Size into the database. How do I find the size?

The best way to find out a size is saving the document to a memory stream:

Document doc = new Document(filename);

MemoryStream stream = new MemoryStream();

doc.Save(stream, SaveFormat.FormatDocument);

long docsize = stream.Length;