Example #1
0
        public void AddXHTMLTextItem(IBaseXHTMLFile baseXhtmlFile)
        {
            var bookItem = new ManifestItemV3
            {
                HRef      = baseXhtmlFile.HRef,
                ID        = baseXhtmlFile.Id,
                MediaType = EPubCoreMediaType.ApplicationXhtmlXml
            };

            _manifest.Add(bookItem);

            if (baseXhtmlFile.GuideRole != GuideTypeEnum.Ignore) // we do not add objects that to be ignored
            {
                var bookSpine = new SpineItemV3 {
                    Name = baseXhtmlFile.Id
                };
                if (V3StandardChecker.IsRenditionFlowAllowedByStandard(_standard))
                {
                    bookSpine.Flow = SpineItemV3.FlowOptions.Auto;
                    //TODO: make this optional, based on settings to define look and find best properties for defaults
                }
                _spine.Add(bookSpine);
            }
            _guide.AddDocumentToNavigation(baseXhtmlFile);
        }
Example #2
0
        public void AddCSS(CSSFile cssFile)
        {
            var maincss = new ManifestItemV3 {
                HRef = cssFile.PathInEPUB.GetRelativePath(DefaultInternalPaths.ContentFilePath, _flatStructure), ID = cssFile.ID, MediaType = CSSFile.MediaType
            };

            _manifest.Add(maincss);
        }
Example #3
0
        public void AddNavigationDocument(NavigationDocumentFile navigationDocument)
        {
            var navItem = new ManifestItemV3
            {
                HRef      = navigationDocument.PathInEPUB.GetRelativePath(DefaultInternalPaths.ContentFilePath, _flatStructure),
                ID        = "nav",
                MediaType = EPubCoreMediaType.ApplicationXhtmlXml,
                Nav       = true,
            };

            _manifest.Add(navItem);
        }
Example #4
0
        public void AddImage(ImageOnStorage image)
        {
            var item = new ManifestItemV3
            {
                HRef      = image.PathInEPUB.GetRelativePath(DefaultInternalPaths.ContentFilePath, _flatStructure),
                ID        = image.ID,
                MediaType = EPUBImage.ConvertImageTypeToMediaType(image.ImageType)
            };

            if (CoverId == image.ID)
            {
                item.CoverImage = true;
            }
            _manifest.Add(item);
        }
Example #5
0
        public void AddTOC()
        {
            if (!GenerateCompatibleTOC)
            {
                return;
            }
            var tocItem = new ManifestItemV3
            {
                HRef      = DefaultInternalPaths.TOCFilePath.GetRelativePath(DefaultInternalPaths.ContentFilePath, _flatStructure),
                ID        = "ncx",
                MediaType = EPubCoreMediaType.ApplicationNCX,
            };

            _spine.TOCId = tocItem.ID;
            _manifest.Add(tocItem);
        }