public bool ExportCopyright(PublicationInformation projInfo, string mainXhtmlFileWithPath) { if (_copyrightInformation) { var preProcess = new PreExportProcess(projInfo); var processFolder = Path.GetDirectoryName(projInfo.DefaultXhtmlFileWithPath); preProcess.CopyCopyrightPage(processFolder); string copyRightFilePath = Common.PathCombine(processFolder, "File2Cpy.xhtml"); if (copyRightFilePath.Trim().Length <= 0 && !File.Exists(copyRightFilePath)) { return false; } if (File.Exists(copyRightFilePath)) { if (Common.UnixVersionCheck()) { string draftTempFileName = Path.GetFileName(copyRightFilePath); draftTempFileName = Common.PathCombine(Path.GetTempPath(), draftTempFileName); if (!File.Exists(draftTempFileName)) { File.Copy(copyRightFilePath, draftTempFileName, true); Common.RemoveDTDForLinuxProcess(draftTempFileName, "xelatex"); } projInfo.DefaultXhtmlFileWithPath = draftTempFileName; copyRightFilePath = draftTempFileName; } else { projInfo.DefaultXhtmlFileWithPath = copyRightFilePath; } } else { return false; } string filepath = Path.GetFullPath(copyRightFilePath); Dictionary<string, Dictionary<string, string>> cssClass = new Dictionary<string, Dictionary<string, string>>(); CssTree cssTree = new CssTree(); cssTree.OutputType = Common.OutputType.XELATEX; cssClass = cssTree.CreateCssProperty(Common.PathCombine(filepath, "copy.css"), true); string fileNameXhtml = Path.GetFileNameWithoutExtension(copyRightFilePath); string xeLatexCopyrightFile = Common.PathCombine(projInfo.ProjectPath, fileNameXhtml + ".tex"); _copyrightTexFileName = xeLatexCopyrightFile; int pageWidth = Common.GetPictureWidth(cssClass, projInfo.ProjectInputType); StreamWriter xeLatexFile = new StreamWriter(xeLatexCopyrightFile); Dictionary<string, List<string>> classInlineStyle = new Dictionary<string, List<string>>(); XeLaTexStyles xeLaTexStyles = new XeLaTexStyles(); xeLaTexStyles.LangFontDictionary = _langFontCodeandName; classInlineStyle = xeLaTexStyles.CreateXeTexStyles(projInfo, xeLatexFile, cssClass); XeLaTexContent xeLaTexContent = new XeLaTexContent(); xeLaTexContent.IsUnix = _isUnixOs; Dictionary<string, List<string>> classInlineText = xeLaTexStyles._classInlineText; xeLaTexContent.CreateContent(projInfo, cssClass, xeLatexFile, classInlineStyle, cssTree.SpecificityClass, cssTree.CssClassOrder, classInlineText, pageWidth); _xelatexDocumentOpenClosedRequired = true; //Don't change the place. CloseDocument(xeLatexFile, false, string.Empty); ModifyXeLaTexStyles modifyXeLaTexStyles = new ModifyXeLaTexStyles(); modifyXeLaTexStyles.XelatexDocumentOpenClosedRequired = true; modifyXeLaTexStyles.ProjectType = projInfo.ProjectInputType; string copyright = GetLanguageInfo(mainXhtmlFileWithPath, projInfo); InsertInFile(xeLatexCopyrightFile, "copyright information", copyright); return true; } return false; }