The open method opens the output stream for writing.
When the document stream is opened, the write and writeln methods can be used to write some content into the document.
If the document was opened by the open method, the close method must be used to close the output stream.

Note: while the document is loading, the document stream is opened for writing.
In that case, there is no need to open and close the output stream.

After the document has been loaded, the open method (if at most two parameters are specified) clears the current document.