saveDocument is deprecated