Load diagram document with options

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 provides DiagramLoadOptions to control how source diagram files are processed. Diagram files include formats like VSD, VSDX, VDX, VSDM, VSSX, and other Microsoft Visio formats.

The following options are available:

OptionDescription
FormatThe document type is auto-detected during loading, but you can explicitly specify the source format. Available options include: Vsd, Vsdx, Vsx, Vtx, Vdx, Vssx, Vstx, Vsdm, Vssm, Vstm
DefaultFontDefault font for rendering the diagram. The following font will be used if a diagram font is missing.

Load VSD file

The following code snippet shows how to load a VSD (Visio Drawing) file with explicit format specification:

using GroupDocs.Conversion;
using GroupDocs.Conversion.FileTypes;
using GroupDocs.Conversion.Options.Convert;
using GroupDocs.Conversion.Options.Load;

Func<LoadContext, LoadOptions> getLoadOptions = loadContext => new DiagramLoadOptions
{
    Format = DiagramFileType.Vsd
};

using (Converter converter = new Converter("design-diagram.vsd", getLoadOptions))
{
    PdfConvertOptions options = new PdfConvertOptions();
    converter.Convert("design-diagram.pdf", options);
}

Load VSDX file

The following code snippet shows how to load a VSDX (Visio Drawing XML) file:

using GroupDocs.Conversion;
using GroupDocs.Conversion.FileTypes;
using GroupDocs.Conversion.Options.Convert;
using GroupDocs.Conversion.Options.Load;

Func<LoadContext, LoadOptions> getLoadOptions = loadContext => new DiagramLoadOptions
{
    Format = DiagramFileType.Vsdx
};

using (Converter converter = new Converter("flowchart.vsdx", getLoadOptions))
{
    PdfConvertOptions options = new PdfConvertOptions();
    converter.Convert("flowchart.pdf", options);
}

Load VSD with default font

The following code snippet shows how to load a VSD file with a default font for missing fonts:

using GroupDocs.Conversion;
using GroupDocs.Conversion.FileTypes;
using GroupDocs.Conversion.Options.Convert;
using GroupDocs.Conversion.Options.Load;

Func<LoadContext, LoadOptions> getLoadOptions = loadContext => new DiagramLoadOptions
{
    Format = DiagramFileType.Vsd,
    DefaultFont = "Arial"
};

using (Converter converter = new Converter("network-diagram.vsd", getLoadOptions))
{
    PdfConvertOptions options = new PdfConvertOptions();
    converter.Convert("network-diagram.pdf", options);
}

Convert VSDX to Word document

The following code snippet shows how to load a VSDX file and convert it to a Word document:

using GroupDocs.Conversion;
using GroupDocs.Conversion.FileTypes;
using GroupDocs.Conversion.Options.Convert;
using GroupDocs.Conversion.Options.Load;

Func<LoadContext, LoadOptions> getLoadOptions = loadContext => new DiagramLoadOptions
{
    Format = DiagramFileType.Vsdx
};

using (Converter converter = new Converter("process-flow.vsdx", getLoadOptions))
{
    WordProcessingConvertOptions options = new WordProcessingConvertOptions();
    converter.Convert("process-flow.docx", options);
}

Convert between diagram formats

The following code snippet shows how to convert from VSD to VSDX format:

using GroupDocs.Conversion;
using GroupDocs.Conversion.FileTypes;
using GroupDocs.Conversion.Options.Convert;
using GroupDocs.Conversion.Options.Load;

Func<LoadContext, LoadOptions> getLoadOptions = loadContext => new DiagramLoadOptions
{
    Format = DiagramFileType.Vsd
};

using (Converter converter = new Converter("legacy-diagram.vsd", getLoadOptions))
{
    DiagramConvertOptions options = new DiagramConvertOptions
    {
        Format = DiagramFileType.Vsdx
    };
    converter.Convert("legacy-diagram.vsdx", options);
}

Convert VSDX to PowerPoint

The following code snippet shows how to load a VSDX file and convert it to a PowerPoint presentation:

using GroupDocs.Conversion;
using GroupDocs.Conversion.FileTypes;
using GroupDocs.Conversion.Options.Convert;
using GroupDocs.Conversion.Options.Load;

Func<LoadContext, LoadOptions> getLoadOptions = loadContext => new DiagramLoadOptions
{
    Format = DiagramFileType.Vsdx
};

using (Converter converter = new Converter("org-chart.vsdx", getLoadOptions))
{
    PresentationConvertOptions options = new PresentationConvertOptions();
    converter.Convert("org-chart.pptx", options);
}