//// This code is part of Document Solutions for Word demos.// Copyright (c) MESCIUS inc. All rights reserved.//usingSystem.IO;usingSystem.Collections.Generic;usingGrapeCity.Documents.Word;usingDsWordWeb.Demos.MarkdownToWordRenderer; namespaceDsWordWeb.Demos{// This example shows how to convert markdown (.md) documents// to MS Word DOCX and PDF formats.//// The conversion is done by the DsWordWeb.Demos.MarkdownToWordRenderer.WordRenderer // class that uses the Markdig package written by Alexandre Mutel// to parse markdown, and the DsWord OM to create MS Word documents from it.//// The WordRenderer source code is included in this sample, to view it// download the sample zip. The MarkdownToWordRenderer sources are located// in the MarkdownToWord subdirectory of the sample zip.publicclassMd2Word {publicGcWordDocumentCreateDocx(string[] sampleParams) {var fn = Path.Combine(sampleParams[3].Split('/'));var markdown = File.ReadAllText(fn);returnWordRenderer.ToWord(markdown); } publicGcWordDocumentCreateDocx(int parsIdx = 0) {returnCreateDocx(GetSampleParamsList()[parsIdx]); } // Mandatory: name, description, info.// Custom: .md file.staticreadonlyList<string[]> s_paramsList = newList<string[]>() {newstring[] { "@md/DsPdfViewer README.md", "Convert the README.md file shipped with DsPdfViewer", null,"Resources/Markdown/DsPdfViewer-README.md" },newstring[] { "@md/DsPdfViewer CHANGELOG.md", "Convert the CHANGELOG.md file shipped with DsPdfViewer", null,"Resources/Markdown/DsPdfViewer-CHANGELOG.md" },newstring[] { "@md/spec.md", "Convert the Markdown specification spec.md file", null,"Resources/Markdown/spec.md" }, }; publicstaticList<string[]> GetSampleParamsList() => s_paramsList; }}