Output format and password

View as MarkdownMarkdown

Set up your AI agent

Give your coding agent live access to the GroupDocs documentation and API reference through the GroupDocs Docs MCP server — no install, no API key. Learn more

claude mcp add --transport http groupdocs-docs https://docs.groupdocs.com/mcp

Also process documents locally

The GroupDocs.Editor MCP server lets your agent work with files on your machine; they are never uploaded. It needs the .NET 10 SDK or Docker.

claude mcp add groupdocs-editor -- dnx GroupDocs.Editor.Mcp --yes
Folders, licensing and more →

WordProcessingSaveOptions class is responsible for tuning and adjusting the saving process, when EditableDocument instance, that contains already edited document content, should be converted to the output document of some WordProcessing format. In other words, the WordProcessingSaveOptions class specifies how exactly the edited HTML should be saved to the output document.

Unlike load and edit options, WordProcessingSaveOptions class has one mandatory constructor, that obtains one parameter — outputFormat. The outputFormat parameter has a WordProcessingFormats type. In turn, this type contains all supported formats from the family of WordProcessing formats, which are supportable for saving document. Each field of WordProcessingFormats struct represent one separate WordProcessing format — DOC, DOCX, RTF, ODT etc. There is also an All field, that allows to enumerate over all WordProcessing formats. So, with the outputFormat parameter user should select a specific format of the output WordProcessing document, which should be generated by the editor.Save() method.

This constructor is mandatory, because it is unacceptable to create a WordProcessingSaveOptions instance without output format; otherwise, how GroupDocs.Editor “should know” into which specific format the document should be saved? However, output format can be changed later, after creating an instance of the WordProcessingSaveOptions class, with the OutputFormat property. This property also has a getter, that allows to obtain output format, specified previously in a constructor.

Almost all WordProcessing formats, especially with binary nature, support file encoding with the password. If such document is encoded, it is required to specify a password for opening it. WordProcessingSaveOptions class has the next property, which allows to set a password:

public string Password { get; set; }

By default the value of this property is NULL, which means that password will not be applied. If user specifies a string in this property, the output document will be encoded and protected with this string as a password. If user had specified some password in this property at some step, but then wants to dismiss password and do not encode the document, he can set the value to NULL or empty string, — both these values will be interpreted as “do not set a password” when calling the editor.Save() method.