Exemplo n.º 1
0
        private static MergeCss _mc; // When mc is disposed it also deletes the merged file

        //public Exportepub(string epub3Path)
        //{
        //    //this.epub3Path = epub3Path;
        //}

        private static string MergeAndFilterCss(PreExportProcess preProcessor, string tempFolder, string cssFullPath)
        {
            var tempFolderName = Path.GetFileName(tempFolder);
            _mc = new MergeCss { OutputLocation = tempFolderName };
            var mergedCss = _mc.Make(cssFullPath, "book.css");
            preProcessor.RemoveDeclaration(mergedCss, "@top-");
            preProcessor.RemoveDeclaration(mergedCss, "@bottom-");
            preProcessor.RemoveDeclaration(mergedCss, "@footnote");
            preProcessor.RemoveDeclaration(mergedCss, "@page");
            preProcessor.RemoveStringInCss(mergedCss, "string-set:");
            preProcessor.RemoveStringInCss(mergedCss, "-moz-column-");
            preProcessor.RemoveStringInCss(mergedCss, "column-fill:");
            preProcessor.RemoveStringInCss(mergedCss, "-ps-outline-");
            preProcessor.RemoveStringInCss(mergedCss, "float:");
            preProcessor.RemoveStringInCss(mergedCss, "-ps-fixed-line-height:");
            preProcessor.RemoveStringInCss(mergedCss, "content: leader(");
            preProcessor.ReplaceStringInCss(mergedCss);
            preProcessor.SetDropCapInCSS(mergedCss);
            preProcessor.InsertCoverPageImageStyleInCSS(mergedCss);
            preProcessor.InsertSectionHeadID();
            return mergedCss;
        }