Load diagram document with options
Leave feedback
On this page
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:
| Option | Description |
|---|---|
| Format | The 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 |
| DefaultFont | Default font for rendering the diagram. The following font will be used if a diagram font is missing. |
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);
}
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);
}
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);
}
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);
}
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);
}
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);
}
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.