Converts documents from Word, Excel, PDF, and other formats to Markdown. Provides both static one-liner methods and an instance-based API with full control over conversion options.
Creates a new converter that reads the document from the supplied stream. The file format is detected automatically from the stream content. If automatic detection is not possible, use the MarkdownConverter overload and specify the format via LoadOptions.
Creates a new converter that reads the document from the supplied stream, using the given load options. Use this overload when reading from a MemoryStream, network stream, or any non-file stream where format detection from a file name is not available.
Creates a new converter for the document at the specified file path, using the given load options. Use this overload to supply a password for encrypted documents or to explicitly specify the file format.
Converts the loaded document to Markdown and writes the output to the specified stream. The Content property will be null; the Markdown bytes are written directly to outputStream.
Converts the loaded document to Markdown with the specified options and saves the result to a file. The file is created (or overwritten) at outputFilePath.
Releases all resources used by this MarkdownConverter instance, including the internal copy of the source document stream. Always call Dispose when you are finished, or use a using statement to ensure timely cleanup.
Retrieves metadata about the loaded document without performing a full conversion. Use this to inspect properties such as page count, title, author, and whether the document is encrypted before deciding how to convert.
Returns metadata about a document (format, page count, title, author, encryption status) without performing a full conversion. This is a lightweight way to inspect a file.
Returns the complete list of FileFormat values that can be converted to Markdown. Use this to check at runtime whether a particular format is supported before attempting conversion.
Converts a document to Markdown and saves the result directly to a file. This is the simplest way to produce a Markdown file from a supported document format.
Converts a document to Markdown with the specified load and conversion options, saving the result to a file. This is the most flexible static overload for file-based output.
Converts a document to Markdown in a single call and returns the Markdown string. This is the simplest way to convert a file. The format is detected automatically.
Converts a document to Markdown using the specified conversion options and returns the Markdown string. Use this overload to control image handling, heading offsets, or page selection.
Converts a document to Markdown using the specified load options and returns the Markdown string. Use this overload to supply a password for encrypted documents or to specify the file format explicitly.
Converts a document to Markdown using the specified load and conversion options, and returns the Markdown string. This is the most flexible static overload, combining format/password control with full conversion customization.
Asynchronously converts the document at the specified path to Markdown. File reading is performed asynchronously; conversion runs on the thread pool.
Remarks
Supported input formats include Word (DOC, DOCX, DOCM, DOT, DOTX, DOTM, RTF, ODT, OTT), Excel (XLS, XLSX, XLSB, XLSM, CSV, TSV, ODS, OTS), PDF, e-books (EPUB, MOBI), plain text (TXT), and CHM help files. Call GetSupportedFormats for the full list.
For quick, one-shot conversions use the static methods ToMarkdown, ToFile, and GetInfo. When you need to customize the conversion (image handling, heading offsets, page selection) or retrieve document metadata alongside conversion, create an instance and call Convert or GetDocumentInfo.
The instance implements IDisposable. Always dispose it when you are done, preferably with a using statement.
Examples
Convert a document to a Markdown string in one line: