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.
fromgroupdocs.markdownimportMarkdownConverter,LoadOptions,FileFormatdefload_specific_format():"""Load a file with an explicitly specified format, skipping auto-detection."""# Step 1: Create load options with the explicit file formatload_options=LoadOptions(FileFormat.XLSX)# Step 2: Open the file with load options using keyword argumentwithMarkdownConverter("cost-analysis.xlsx",load_options=load_options)asconverter:# Step 3: Convert and save the Markdown outputconverter.convert("load-specific-format.md")if__name__=="__main__":load_specific_format()
cost-analysis.xlsx is sample file used in this example. Click here to download it.
The FileFormat enum includes the following values:
Category
Values
Word Processing
DOC, DOCX, DOCM, DOT, DOTX, DOTM, RTF, ODT, OTT
Spreadsheet
XLSX, XLS, XLSB, XLSM, CSV, TSV, ODS, OTS
PDF
PDF
E-book
EPUB, MOBI
Text
TXT
Help
CHM
You can also retrieve supported formats programmatically:
fromgroupdocs.markdownimportMarkdownConverterdefget_supported_formats():"""List all file formats supported by GroupDocs.Markdown."""# Step 1: Retrieve the list of supported formatsformats=MarkdownConverter.get_supported_formats()# Step 2: Print each supported formatforfmtinformats:print(fmt)if__name__=="__main__":get_supported_formats()
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.