Load a file of a specific 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.Markdown 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-markdown -- dnx GroupDocs.Markdown.Mcp --yes
Folders, licensing and more →

By default, GroupDocs.Markdown detects the file format automatically from the file extension or stream content. When you want to skip auto-detection or the file extension is missing, specify the format explicitly using LoadOptions.

import com.groupdocs.markdown.*;

public class LoadSpecificFormat {

    public static void main(String[] args) {
        // Explicitly specify the format to skip auto-detection
        LoadOptions loadOptions = new LoadOptions(FileFormat.XLSX);

        try (MarkdownConverter converter = new MarkdownConverter("cost-analysis.xlsx", loadOptions)) {
            converter.convert("load-specific-format.md");
        }
    }
}

cost-analysis.xlsx is a sample file used in this example. Click here to download it.

## Summary

| Category | FY2024 | FY2025 | FY2026 |
| --- | --- | --- | --- |
| Parts and materials | $1,325,000.00 | $1,480,000.00 | $1,620,000.00 |
| Manufacturing equipment | $900,500.00 | $980,000.00 | $1,050,000.00 |
| Warehousing | $420,000.00 | $510,000.00 | $590,000.00 |
| Shipping | $380,000.00 | $445,000.00 | $520,000.00 |
| Marketing | $250,000.00 | $340,000.00 | $480,000.00 |
| R&D | $180,000.00 | $230,000.00 | $310,000.00 |
[TRUNCATED]

Download full output

Available FileFormat values

The FileFormat enum includes the following values:

CategoryValues
Word ProcessingDoc, Docx, Docm, Dot, Dotx, Dotm, Rtf, Odt, Ott
SpreadsheetXlsx, Xls, Xlsb, Xlsm, Csv, Tsv, Ods, Ots
PDFPdf
E-bookEpub, Mobi
TextTxt
HelpChm

You can also retrieve supported formats programmatically:

import com.groupdocs.markdown.*;

import java.util.List;

public class LoadSupportedFormats {

    public static void main(String[] args) {
        List<FileFormat> formats = MarkdownConverter.getSupportedFormats();
        for (FileFormat fmt : formats) {
            System.out.println(fmt);
        }
    }
}
DOC
DOCX
DOCM
DOT
DOTX
DOTM
RTF
ODT
OTT
XLSX
[TRUNCATED]

Download full output