Пример #1
0
        public static void Export(string filename,
                                  string cssFilename,
                                  string htmlContent)
        {
            string cssContent = File.ReadAllText(Path.Combine(App.AppPath, $@"Resources\CSS\{ cssFilename }.css"));
            string html       = HTMLExporter.CompileHTMLDoc(filename, cssContent, htmlContent);

            File.WriteAllBytes(filename, new SimplePechkin(new GlobalConfig()).Convert(html));

            System.Diagnostics.Process.Start(filename);
        }
Пример #2
0
        public static void Export(string exportType,
                                  string filename,
                                  string cssFilename,
                                  string htmlContent)
        {
            string cssContent = File.ReadAllText(Path.Combine(App.AppPath, $@"Resources\CSS\{ cssFilename }.css"));
            string html       = HTMLExporter.CompileHTMLDoc(filename, cssContent, htmlContent);

            string tempFilename = Path.GetTempFileName();

            File.WriteAllText(tempFilename, html);

            PandocConverter.Export("html", exportType, tempFilename, filename);

            File.Delete(tempFilename);

            System.Diagnostics.Process.Start(filename);
        }