FromMarkdown

FromMarkdown(string, string)

Converts a Markdown file to a document format. The output format is inferred from the file extension of outputPath (e.g. .docx, .pdf).

public static void FromMarkdown(string markdownPath, string outputPath)
Parameter Type Description
markdownPath String Path to the source Markdown file.
outputPath String Path where the output document will be saved. The extension determines the format.

Exceptions

exception condition
GroupDocsMarkdownException Thrown when conversion fails.
NotSupportedException Thrown when the output format is not supported.

Examples

MarkdownConverter.FromMarkdown("readme.md", "readme.docx");
MarkdownConverter.FromMarkdown("readme.md", "readme.pdf");

See Also


FromMarkdown(string, string, ExportOptions)

Converts a Markdown file to a document format with the specified export options.

public static void FromMarkdown(string markdownPath, string outputPath, ExportOptions options)
Parameter Type Description
markdownPath String Path to the source Markdown file.
outputPath String Path where the output document will be saved.
options ExportOptions Export options. Use Format to override format detection, or pass null to infer from the output file extension.

Exceptions

exception condition
GroupDocsMarkdownException Thrown when conversion fails.
NotSupportedException Thrown when the output format is not supported.

Examples

var options = new ExportOptions(FileFormat.Pdf);
MarkdownConverter.FromMarkdown("readme.md", "output.pdf", options);

See Also