SaveToStream(Stream: IIOStream);
SaveToStream(Stream: System.IO.Stream);
Stream. The stream, to which the document is loaded.
The SaveToStream method saves the document contents into the stream.
Executing the example requires the Document object with the Document_1 identifier in repository.
Sub UserProc;
Var
MB: IMetabase;
Stream: IMemoryStream;
Doc: IDocument;
Begin
MB := MetabaseClass.Active;
Doc := MB.ItemById("Document_1").Bind As IDocument;
Stream := New MemoryStream.Create;
Doc.SaveToStream(Stream);
Debug.WriteLine(Stream.Size.ToString);
Dispose Stream;
End Sub UserProc;
After executing the example the size of the file loaded in the Document_1 document is displayed in the development environment console in bytes.
See also: