private void ConvertAnnotation(ItemTitleInfo titleInfo, EPubFileV2 epubFile) { if (titleInfo.Annotation != null) { var desc = new Description { DescInfo = titleInfo.Annotation.ToString(), }; epubFile.BookInformation.Description = desc; var converterSettings = new ConverterOptionsV2 { CapitalDrop = Settings.CommonSettings.CapitalDrop, Images = Images, MaxSize = Settings.V2Settings.HTMLFileMaxSize, ReferencesManager = _referencesManager, }; var annotationConverter = new AnnotationConverterV2(); var annotationPage = new AnnotationPageFileV2 { BookAnnotation = (Div)annotationConverter.Convert(titleInfo.Annotation, new AnnotationConverterParamsV2 { Settings = converterSettings, Level = 1 }) }; StructureManager.AddAnnotationPage(annotationPage); } }
/// <summary> /// Passes FB2 info to the EPub file to be added at the end of the book /// </summary> /// <param name="epubFile">destination epub object</param> /// <param name="fb2File">source fb2 object</param> private void PassFb2InfoToEpub(EPubFileV2 epubFile, FB2File fb2File) { if (!Settings.ConversionSettings.Fb2Info) { return; } var infoDocument = new BaseXHTMLFileV2 { Id = "FB2 Info", Type = SectionTypeEnum.Text, FileEPubInternalPath = EPubInternalPath.GetDefaultLocation(DefaultLocations.DefaultTextFolder), FileName = "fb2info.xhtml", GuideRole = GuideTypeEnum.Notes, NotPartOfNavigation = true }; var converterSettings = new ConverterOptionsV2 { CapitalDrop = false, Images = Images, MaxSize = Settings.V2Settings.HTMLFileMaxSize, ReferencesManager = _referencesManager, }; var infoConverter = new Fb2EpubInfoConverterV2(); infoDocument.Content = infoConverter.Convert(fb2File, converterSettings); StructureManager.AddAboutPage(infoDocument); }