Calling this method will release all the resources allocated by the pdf document.
Important
Always call this method after the document was saved.
Note
If the document was created from a stream, the stream will be closed if it was not explicitly detached
by calling the DetachStream before the document is closed.