All static and instance methods have async counterparts. File I/O is truly asynchronous — source files are read and output files are written using async streams. CPU-bound conversion runs on the thread pool.
Note
The async API is available on .NET 6.0+ and .NET Framework 4.6.2+.
Static async methods
usingGroupDocs.Markdown;// Convert to stringstringmd=awaitMarkdownConverter.ToMarkdownAsync("business-plan.docx");// Convert to fileawaitMarkdownConverter.ToFileAsync("business-plan.docx","report.md");// With optionsvaroptions=newConvertOptions{IncludeFrontMatter=true};stringmd=awaitMarkdownConverter.ToMarkdownAsync("business-plan.docx",null,options);// Get document infoDocumentInfoinfo=awaitMarkdownConverter.GetInfoAsync("business-plan.docx");Console.WriteLine($"{info.FileFormat}, {info.PageCount} pages");
business-plan.docx is a sample file used in this example. Click here to download it.
usingGroupDocs.Markdown;usingvarconverter=newMarkdownConverter("business-plan.docx");// Convert to stringawaitconverter.ConvertAsync("async-instance.md");// Convert with optionsvaroptions=newConvertOptions{HeadingLevelOffset=1};ConvertResultresult=awaitconverter.ConvertAsync(options);// Convert to fileawaitconverter.ConvertAsync("async-instance.md");// Get document infoDocumentInfoinfo=awaitconverter.GetDocumentInfoAsync();
business-plan.docx is a sample file used in this example. Click here to download it.