Saves the document synchronously. This is an IO operation and is not recommended to execute in the UI thread.