Get default ConvertOptions for specific target format

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.Conversion 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-conversion -- dnx GroupDocs.Conversion.Mcp --yes
Folders, licensing and more →

GroupDocs.Conversion allows to get default convert options for specific target format by following the below steps:

  1. Create new instance of Converter class by passing source document path as constructor’s parameter
  2. Call GetPossibleConversions method of converter object
  3. Use the file extension or FileType as key to indexer of object received as value in previous step

The following code snippet shows how to get possible conversions of the source document:

using (var converter = new Converter("source.docx"))
{
    var possibleConversions = converter.GetPossibleConversions();
    var targetConversion = possibleConversions["pdf"];
    var convertOptions = targetConversion?.ConvertOptions;
    if (convertOptions != null)
    {
        converter.Convert("converted.pdf", convertOptions);
    }
}