Load DocLang 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 DocLangLoadOptions for loading DocLang documents: bare DocLang markup (.dclg) or a DocLang archive (.dclx). The following option can be set:

OptionDescription
FormatThe input file type, DocLangFileType.Dclg or DocLangFileType.Dclx. It is null until it is set. Set it to load a stream without a name as DCLG or DCLX whatever its content.

A DocLang document is read into a Word document and then converts to every format a DOCX document converts to, DocLang excepted. See Convert to and from DocLang for the supported conversions.

Load a DocLang stream

When the source is a stream, GroupDocs.Conversion detects DocLang from its content. To state the format yourself, return DocLangLoadOptions with the format set:

Func<LoadContext, LoadOptions> getLoadOptions = loadContext => new DocLangLoadOptions
{
    Format = DocLangFileType.Dclg
};
using (Converter converter = new Converter(() => File.OpenRead("sample.dclg"), getLoadOptions))
{
    PdfConvertOptions options = new PdfConvertOptions();
    converter.Convert("converted.pdf", options);
}

What is not loaded

  • Input that is not valid DocLang 0.9 is refused with CorruptOrDamagedFileException.
  • External resources that a DocLang document names are never loaded.